1 Star 0 Fork 6

Joey/NSIS_SetupSkin

forked from woytu/NSIS_SetupSkin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
makensiscode.bat 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
woytu 提交于 2019-05-12 13:19 +08:00 . Initial commit
::chcp 65001
cd /d %~dp0
@set DestPath=%cd%\FilesToInstall\
@echo off& setlocal EnableDelayedExpansion
@set DestFiles=%cd%\SetupScripts\app.nsh
if exist %DestFiles% del /f %DestFiles%
@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 判断文件夹是否为空
dir /a /s /b %%a | findstr . >nul && (
@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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/burning2017/NSIS_SetupSkin.git
git@gitee.com:burning2017/NSIS_SetupSkin.git
burning2017
NSIS_SetupSkin
NSIS_SetupSkin
master

搜索帮助