在无声模式下运行时,Inno Setup会频繁崩溃

时间:2016-05-02 07:28:09

标签: crash inno-setup

所以我用以下命令运行我的安装程序:

C:\Program Files (x86)\Example\ExampleSetup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

但是由于一些奇怪的原因,安装程序有50%的失败几率,当它失败时会返回0-3的随机退出代码。
我认为这可能是因为/VERYSILENT因为我在非静默运行时从未目睹过这种行为。
我也在SetupMutex部分中使用了[Setup],那么它的崩溃时间是一半吗?
如果进程崩溃,我也想获得有意义的退出代码,以便我可以调试问题 这是日志输出:

2016-05-02 11:33:01.421   Log opened. (Time zone: UTC+03:00)
2016-05-02 11:33:01.421   Setup version: Inno Setup version 5.5.6 (u)
2016-05-02 11:33:01.421   Original Setup EXE: C:\Program Files (x86)\Maprinter\MaprinterSetup.exe
2016-05-02 11:33:01.421   Setup command line: /SL5="$F403AE,242855,184832,C:\Program Files (x86)\Maprinter\MaprinterSetup.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART "/LOG=C:\Program Files (x86)\Maprinter\MaprinterSetup.log" Restart
2016-05-02 11:33:01.421   Windows version: 10.0.10586  (NT platform: Yes)
2016-05-02 11:33:01.421   64-bit Windows: Yes
2016-05-02 11:33:01.421   Processor architecture: x64
2016-05-02 11:33:01.421   User privileges: Administrative
2016-05-02 11:33:01.422   64-bit install mode: No
2016-05-02 11:33:01.425   Created temporary directory: C:\WINDOWS\TEMP\is-SM12R.tmp
2016-05-02 11:33:01.494   Extracting temporary file: C:\WINDOWS\TEMP\is-SM12R.tmp\InnoCallback.dll
2016-05-02 11:33:01.593   Extracting temporary file: C:\WINDOWS\TEMP\is-SM12R.tmp\unzipper.dll
2016-05-02 11:33:01.723   Exception message:
2016-05-02 11:33:01.723   Defaulting to OK for suppressed message box (OK):
                          Error reading WelcomeLabel2.Caption: System Error.  Code: 1411.
                          Class does not exist.
2016-05-02 11:33:01.723   Deinitializing Setup.
2016-05-02 11:33:01.728   Log closed.

这是针对同一问题的不同日志输出:

2016-05-02 12:04:50.495   Log opened. (Time zone: UTC+03:00)
2016-05-02 12:04:50.495   Setup version: Inno Setup version 5.5.6 (u)
2016-05-02 12:04:50.495   Original Setup EXE: C:\Program Files (x86)\Maprinter\MaprinterSetup.exe
2016-05-02 12:04:50.495   Setup command line: /SL5="$177016C,242855,184832,C:\Program Files (x86)\Maprinter\MaprinterSetup.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=C:\Users\yuvadius\Desktop\MaprinterSetup.log Restart
2016-05-02 12:04:50.495   Windows version: 10.0.10586  (NT platform: Yes)
2016-05-02 12:04:50.495   64-bit Windows: Yes
2016-05-02 12:04:50.495   Processor architecture: x64
2016-05-02 12:04:50.495   User privileges: Administrative
2016-05-02 12:04:50.496   64-bit install mode: No
2016-05-02 12:04:50.500   Created temporary directory: C:\WINDOWS\TEMP\is-NFR0Q.tmp
2016-05-02 12:04:50.528   Extracting temporary file: C:\WINDOWS\TEMP\is-NFR0Q.tmp\InnoCallback.dll
2016-05-02 12:04:50.607   Extracting temporary file: C:\WINDOWS\TEMP\is-NFR0Q.tmp\unzipper.dll
2016-05-02 12:04:50.763   Exception message:
2016-05-02 12:04:50.763   Defaulting to OK for suppressed message box (OK):
                          System Error.  Code: 8.
                          Not enough storage is available to process this command.
2016-05-02 12:04:50.763   Deinitializing Setup.
2016-05-02 12:04:50.770   Log closed.

所以我的具体问题是:为什么我的安装程序经常崩溃,我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:0)

我首先暂时删除“计时器”的东西。

计时器很快就会在快速静默安装完成时到期,因此mytimerproc正在尝试访问不再存在的窗口或者pascal脚本是引擎被破坏。

如果证明是这种情况(实际上即使没有),你应该解决这些问题:

  • 您需要在安装程序关闭时销毁计时器(可能来自CurStepChanged(ssDone)
  • 您可能甚至不想在非常安静的安装中安排计时器,因为没有形式可以透明。
  • 您应该在InitializeWizard中安排计时器,而不是在InitializeSetup,因为如果安装程序启动缓慢,当计时器到期时,窗口甚至不存在,否则会存在风险。