我正在尝试构建一个NSIS安装程序,它将执行以下操作:
1当正常运行时,它将使用具有常规选项的安装程序安装应用程序.
2当使用/ S开关运行安装程序时,它会进行静默安装,如果它显示UI则没问题.但它应该是自动的.
在我看来,安装程序"工作",因为它运行,然后再次正确启动应用程序.但它没有更新任何东西,它几乎就像它运行,但不复制任何文件.
当它是静默安装时,它由以下代码启动(应用程序更新自身)
ProcessStartInfo Pro = new ProcessStartInfo();
Pro.Verb = "runas";
Pro.UseShellExecute = true;
Pro.FileName = gDownloadedFileName;
Pro.Arguments = "/S";
Pro.WindowStyle = ProcessWindowStyle.Normal;
Pro.CreateNoWindow = true;
Run Code Online (Sandbox Code Playgroud)
NSIS脚本主(我可以发布NSIS的支持脚本,如果ppl需要自定义)
; example2.nsi
;
; This script is based on example1.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install example2.nsi into a directory that the user selects,
!include MUI.nsh
!include fileassoc.nsh
!include Silent.nsh
!define _AppName "My application"
!define _AppExe …Run Code Online (Sandbox Code Playgroud)