Inno Setup 生成的安装程序在某些系统上不显示 "Select Destination Location" 页面

Inno Setup generated installer does not show "Select Destination Location" page on some systems

我使用 py2exe 创建我的应用程序,并使用 Windows 7 上的 Inno Setup 将其打包到安装程序 exe 中。这样创建的安装程序可以安装在 Windows 7 上和 Windows 10 个系统。当它工作时,安装程​​序会依次显示以下屏幕:

  1. 欢迎屏幕
  2. 最终用户许可协议屏幕
  3. 默认(或以前的安装)位置,允许用户select新安装位置,
  4. 正在确认安装位置,并且
  5. 通常的安装屏幕。

这是我使用 Inno Setup 5.5.5 或更低版本时的行为。

使用 Inno Setup 5.5.7 及更高版本(未尝试 5.5.6),安装程序可正常创建并可在 Windows 7 上按上述方式设置. 但是,同一安装程序在 Windows 10 上的安装过程中无法显示上面列表中的屏幕 1 和 3:安装程序直接从 EULA 屏幕开始,然后跳转到确认安装位置。确认屏幕甚至不显示安装将完成的目录。

继续允许在默认位置进行安装并且应用程序正常运行。不知道安装位置是非常烦人和不受欢迎的。

我使用的 .iss 文件(见下文)在我尝试过的不同 Inno Setup 版本中是相同的。在文件中,DefaultDirName 被显式设置(基于应用程序的版本)。

; WARNING: This script has been created by py2exe. Changes to this script
; will be overwritten the next time py2exe is run!

[Setup]
AppName=MyApp
AppVersion=2.0.1
AppVerName=MyApp 2.0.1
AppPublisher=Company, Inc.
AppPublisherURL=www.company.com
AppContact=support@company.com
AppCopyright=Copyright (C) 2010-2016, Company, Inc.
LicenseFile=license\MyAppEULA.rtf
SetupIconFile=icons\CompanyScreeningProgram.ico
WizardImageFile=icons\MyAppImage.bmp
WizardSmallImageFile=icons\MyAppSmallImage.bmp
DefaultDirName=C:\MyApp_v2.0.1
DefaultGroupName=MyApp
Compression=lzma
OutputDir=F:\Python\dist\
OutputBaseFilename=MyApp_2.0.1_Setup

[Files]
Source: "MyApp_main.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "lib\_bsddb.pyd"; DestDir: "{app}\lib"; Flags: ignoreversion
;.
;.
;.  600 lines of Source:
Source: "mpl-data\stylelib\grayscale.mplstyle"; DestDir: "{app}\mpl-data\stylelib"; Flags: ignoreversion

我还尝试在 Windows10 上使用 Inno Setup(5.5.7 和 5.5.9)打包安装程序,但它具有相同的行为。

我想知道我是否需要为安装程序设置额外的参数才能在 Windows 10 上正常工作,也适用于较新版本的 Inno Setup?

引用 revision history for Inno Setup 5.5.7:

As recommended by Microsoft's desktop applications guideline, DisableWelcomePage now defaults to yes. Additionally DisableDirPage and DisableProgramGroupPage now default to auto. The defaults in all previous versions were no.


结论:

  • 默认情况下不再显示欢迎页面。要启用它,请设置 DisableWelcomePage:

    DisableWelcomePage=no
    

    我认为您对页面显示在 Windows 7 上的说法不正确。

  • "Select Destination Location" 页面仅针对全新安装显示,不适用于 "upgrades"。所以这与 Windows 7 与 Windows 10 无关。不同之处可能是您将应用程序安装在 Windows 10 系统上;并且您没有在 Windows 7 系统上安装它。

    要始终显示页面,请设置 DisableDirPage:

    DisableDirPage=no
    

上面引述中提到的想法,建议使用默认值,因此您应该遵循它们。

我发现了另一个影响它的参数。

CreateAppDir=no

CreateAppDir 页面中说:

If this is set to no, no directory for the application will be created, the Select Destination Location wizard page will not be displayed, and the {app} directory constant is equivalent to the {win} directory constant. If the uninstall feature is enabled when CreateAppDir is no, the uninstall data files are created in the system's Windows directory.

这里我用了

[Setup]
DisableDirPage=No

默认此参数设置为auto.

If this is set to auto, at startup Setup will look in the registry to see if the same application is already installed, and if so, it will not show the Select Destination Location wizard page.

https://jrsoftware.org/ishelp/index.php?topic=setup_disabledirpage

中查看更多内容