Announcement

Collapse
No announcement yet.

Simple Post Build Cmd file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simple Post Build Cmd file

    As I'm (slowly) moving my plugins over to HS4 format/style, I created a simple(ish) CMD file which others might find useful,

    I won't upload (to avoid any problems with Cmd files being executable), but lines between hyphen lines -

    ================ _Package.Cmd ====================

    @Cls
    @Echo Make the HSPI exe from Visual Studio
    @Echo Run this Cmd file
    @Echo If deploying to HomeSeer - run from elavated prompt
    @Pause

    @REM Where is HomeSeer and where are the Install files?
    Set Root=D:\Documents\Projects\HomeSeer\HSPI_NetK8055\Install
    Set HS=C:\Program Files (x86)\HomeSeer

    D:
    CD %Root%

    @REM Copy any files that aren't already here (Install\ folder).
    Copy /y ..\bin\Debug\HSPI_NetK8055.exe
    Copy /y ..\html\CreateDevice.html

    Del HSPI_NetK8055_4_0_0_0.zip

    @REM 'Touch' the files to make the times consistent.
    Copy /b *.* ,,+

    @REM Zip it.
    PowerShell Compress-Archive -LiteralPath '%Root%\K8055.png', '%Root%\Install.Txt', '%Root%\HSPI_NetK8055.exe', '%Root%\HSPI_NetK8055.exe.config', '%Root%\CreateDevice.html', '%Root%\K8055D.dll', '%Root%\NetK8055.Cfg' -DestinationPath "%Root%\HSPI_NetK8055_4_0_0_0.zip"


    Set /P Deploy=Do you want to copy to HomeSeer (Y/N)?
    If /i "%Deploy:~,1%" Equ "N" Goto NoCopy:
    Copy /y *.zip "%HS%
    Copy /y *.json "%HS%"

    :NoCopy

    =================================================

    I (obviously call it _Package.Cmd - that way it is at the top of a directory listing (do the same things with _ReadMe.Txt files).

    Maybe you might find it useful, hope so.

    See, I'm not ALWAYS negative about HS4.......
Working...
X