我必须编写一个 NSIS 脚本来在服务器上部署报告。当我使用localhost时它工作正常。
现在我想将此包发送给我的客户端,但问题是我不知道客户端的服务器 IP 为此我编写了 .ini 文件。ini文件的内容是
部署报告.ini
[SETTINGS]
ServerIp=localhost
UserName=
PassWord=
部署报告.nsi
# Script generated by DeepSofts - NSIS Script Generator
# Beginning Basic Section Script ...
Name 'DeployReport'
Icon 'modern-install-full.ico'
OutFile 'DeployReport.exe'
SilentInstall Normal
CRCCheck On
Section GetIP 0
ReadINIStr $ip "DeployReport.ini" "SETTINGS" "ServerIp"
MessageBox MB_OK "$ip"
SectionEnd
Section Command 1
Exec '"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\rs.exe" -i PublishSampleReports.rss -s http://localhost/reportserver"'
SectionEnd
ComponentText 'A few details about the application that you have created'
AutoCloseWindow True
SetCompress Auto
SetDateSave On
SetDataBlockOptimize On
问题是 DeployReport.nsi 脚本工作正常,直到我不使用 部分 GetIP 0并且我无法在脚本中找到错误。