我必须编写一个NSIS脚本来在服务器上部署报告。当我使用 localhost 时,它可以正常工作。
现在我想将此软件包发送给我的客户端,但问题是我不知道客户端的SERVER IP为此我编写了.ini文件。 ini文件的内容是
DeployReport.ini
[SETTINGS]
ServerIp=localhost
UserName=
PassWord=
DeployReport.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脚本工作正常,直到我不使用 Section GetIP 0 ,我无法在脚本中找到错误。
答案 0 :(得分:0)
您应该使用.ini("$exedir\DeployReport.ini"
)