简体   繁体   English

使用Jenkins构建我的NSIS安装程序

[英]Building my NSIS installer using Jenkins

I am very new to Jenkins and want it to build a complete .exe. 我对詹金斯(Jenkins)非常陌生,希望它构建一个完整的.exe。 I set the Repository to a personal URL, now Jenkins do read all the files and copies everything to the Jenkins Workspace. 我将存储库设置为个人URL,现在Jenkins确实读取了所有文件并将所有内容复制到Jenkins Workspace。 My question is what do I insert into the "Execute Windows Batch Command" block in Jenkins so that it would Compile a NSIS script and store the Setup file in a output file. 我的问题是,我应该在Jenkins的“ Execute Windows Batch Command”块中插入什么内容,以便它将编译NSIS脚本并将安装文件存储在输出文件中。 I have done research into Windows Batch Scripting but nothing that could truly help me in this struggle. 我已经完成了Windows批处理脚本的研究,但没有什么可以真正帮助我解决这一难题。 If I am doing it all wrong I would love some advice to get me on the right track. 如果我做错了一切,我希望得到一些建议,以使我走上正确的道路。 Here are my current Jenkins codes to read and safe the files from the repository: 这是我当前的Jenkins代码,用于从存储库读取文件并保护文件的安全:

1st "Execute Batch Command" 第一个“执行批处理命令”

 COPY "C:\\Program Files (x86)\\Jenkins\\jobs\\Job_name\\Path\\*.*" "C:\\Program Files (x86)\\Jenkins\\jobs\\Job_Name\\workspace\\Output\\Installs" /Y 

2nd "Execute Batch Command" 第二个“执行批处理命令”

 del c:\\inetpub\\wwwroot\\downloads\\%SVN_REVISION%\\*.* /s /f /q rmdir "C:\\inetpub\\wwwroot\\downloads\\%SVN_REVISION%" exit 0 

3rd "Execute Batch Command" 第三个“执行批处理命令”

 MKDIR "C:\\inetpub\\wwwroot\\downloads\\%SVN_REVISION%" 

4th "Execute Batch Command" 第四个“执行批处理命令”

COPY "C:\\Program Files (x86)\\Jenkins\\jobs\\Job_Name\\workspace\\Output\\Installs" "c:\\inetpub\\wwwroot\\downloads\\%SVN_REVISION%" /Y COPY“ C:\\ Program Files(x86)\\ Jenkins \\ jobs \\ Job_Name \\ workspace \\ Output \\ Installs”“ c:\\ inetpub \\ wwwroot \\ downloads \\%SVN_REVISION%” / Y

Now all I want Jenkins to do is open my .nsi script, compile and create the Setup File which then saves in an output folder. 现在,我希望Jenkins要做的就是打开.nsi脚本,编译并创建安装文件,然后将其保存在输出文件夹中。

Create new batch command with following: 使用以下命令创建新的批处理命令:

path_to_NSIS_folder>\\makensis.exe path_to_your_nsi_file path_to_NSIS_folder> \\ makensis.exe path_to_your_nsi_file

makensis.exe is a NSIS compiler and all it needs is path to the script file (.nsi). makensis.exe是NSIS编译器,它所需要的只是脚本文件(.nsi)的路径。

When run the script is compiled and (if no errors) reslting setup.exe is created (the output can se set in .nsi file). 运行时,将编译脚本并创建(如果没有错误)重新排序setup.exe(可以在.nsi文件中设置输出)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM