A sample cmd script combiling nsis scripts recursively

From NSIS Wiki

Windows Batch File

@echo off
REM RECURSIVE NSIS COMPILER - DOCS AT THE END ...
 
set _ProjectName=YourProjectNameHere
 
set _SystemVersion=0.0.1
ECHO  DEV , TEST , QA , FB , PROD
 
set _EnvironmentType=dev
ECHO  the owner of this environment
 
 set _EnvironmentOwner=ysg
ECHO  the root path to start the 
 
set _RootPath=E:
 
set _BuildInstallersBaseDir=%_RootPath%\%_ProjectName%\%_ProjectName%.%_SystemVersion%.%_EnvironmentType%.%_EnvironmentOwner%\sfw\nsi\
 
 
ECHO DELETE ALL THE EXE FILES 
ECHO.
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.exe" /s /b') do CMD /C start /min cmd /c DEL /S /Q "%%i" 
ECHO.
 
ECHO DELETE FIRST ALL THE EXES
ECHO.
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.txt" /s /b') do CMD /C start /min cmd /c DEL /S /Q "%%i" 
ECHO.
 
echo DELETE  ALL THE zip FILES 
ECHO.
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.zip" /s /b') do CMD /C start /min cmd /c DEL /S /Q "%%i" 
ECHO.
 
ECHO BUILD ALL THE INSTALL SCRIPTS TO EXE'S
ECHO.
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.nsi" /b /s') do cmd /c start /min cmd /c echo BUILDING %%i&"%ProgramFiles(x86)%\NSIS\makensis.exe" /V4 %%i
ECHO.
 
ECHO ZIP THEM ALSO 
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.exe" /s /b') do "%ProgramFiles(x86)%\IZArc\IZArc.exe" -ad "%%i" 
ECHO.
 
ECHO rename the exes to txt files
ECHO.
for /f "tokens=*" %%i in ('dir "%_BuildInstallersBaseDir%\*.zip" /s /b') do copy /y %%i %%i.txt 
ECHO.
 
 
ECHO DONE 
PAUSE
 
ECHO  FILE:BuildAllinstallersWithOUT_PAUSE.2.0.cmd
ECHO  PURPOSE: To compile all the nsi scripts recursively, zip them and rename them to *.zip.txt
ECHO  REQUIREMENTS: google download nsis , and time module
ECHO  REQUIREMENTS: google download IZarc + command line add-on
ECHO  AUTHOR:Yordan Georiev
ECHO  HINT: Place a desktop icon , right click assign N as shortcut , call wiht AltGr + N
Personal tools
donate
ads