postcat/build/makensiscode.bat
秦圆圆 ab2cdfbdda init
2022-01-17 14:50:31 +08:00

57 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

chcp 65001
For %%A in ("%cd%") do (
@set Folder=%%~dpA
)
@set DestPath=%Folder%release\win-unpacked\
@echo off& setlocal EnableDelayedExpansion
@set DestFiles=%cd%\SetupScripts\app.nsh
del ".\SetupScripts\app.nsh"
@set total=1
@echo off
@rem
for /f "tokens=*" %%a in ('dir /s/b/a-d %DestPath%') do (
@set /a total+=1
)
@set curr=0
@set tmpValue=1
@rem
for /f "delims=*" %%d in ('dir /a-d/b %DestPath%') do (
set /a curr+=1
@echo Push !total! >> %DestFiles%
@echo Push !curr! >> %DestFiles%
@echo Call ExtractCallback >> %DestFiles%
@echo File "%DestPath%%%d" >> %DestFiles%
@rem @echo "%%d"
)
@rem NSIS指令
@set dstString=
for /f "delims=*" %%a in ('dir /s/ad/b %DestPath%') do (
@set foldername=%%a
@set "foldername=!foldername:%DestPath%=%dstString%!"
@rem @echo !foldername!
@rem OutputPath
@echo SetOutPath "$INSTDIR\!foldername!" >> %DestFiles%
@rem
for /f "delims=*" %%c in ('dir /a-d/b %%a') do (
@set /a curr+=1
@echo Push !total! >> %DestFiles%
@echo Push !curr! >> %DestFiles%
@echo Call ExtractCallback >> %DestFiles%
@echo File "%%a\%%c" >> %DestFiles%
@rem @echo "%%c"
)
)
@echo Push %total% >> %DestFiles%
@echo Push %total% >> %DestFiles%
@echo Call ExtractCallback >> %DestFiles%
chcp 936