Inno Setup:如何为“选择目标位置"页面指定多个目录? [英] Inno Setup: how do I specify multiple directories for Select Destination Location page?

查看:464
本文介绍了Inno Setup:如何为“选择目标位置"页面指定多个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个安装程序,其中包含32位和64位dll.在64位系统上,我想在32位系统上安装这两个版本,而只是32位版本.

I have an installer, which contains a 32-bit and 64-bit dll. On 64-bit systems I want to install both versions, on 32-bit systems, just the 32-bit version.

我的[Files]部分如下:

[Files]
Source: "C:\Users\..\x64\my.dll"; DestDir: "{pf64}\{#MyPath}"; Check: IsWin64
Source: "C:\Users\..\my.dll"; DestDir: "{pf32}\{#MyPath}"

一切正常,除了如果我覆盖选择目标位置"页面中的安装目录

This all works fine, except that if I override the install directory in the "Select Destination Location" page

  • 首先,仅让我覆盖pf32路径
  • 第二,如果我覆盖安装目录,则什么也不会安装

是否可以设置安装程序,以使选择目标位置"出现两次,一次出现在32位位置,一次出现在64位位置?

Is there a way to set up the installer so that the "Select Destination Location" gets presented twice, once for the 32-bit location and once for the 64-bit one?

推荐答案

最简单的方法是为第二个目录添加一个附加页面.

The easiest is to add an additional page for the second directory.

有关示例,请参见:

  • the Prompt for an additional folder for data article on ISXKB;
  • Inno Setup with three destination folders.

您当然也可以在标准的选择目标位置"页面上添加第二个框.但这还需要更多工作.

You can of course also add the second box to the standard "Select Destination Location" page. But that's more work.

更容易实现的实际上可能是完全禁用选择目标位置"页面(通过设置

Easier to implement might actually be to disable the "Select Destination Location" page altogether (by setting DisableDirPage to yes) and implement a new similar page using the technique described above.

在这种情况下,请确保将安装目录设置为选定的自定义目录之一,以便Inno Setup知道将卸载数据存储到的位置.否则,Inno Setup仍将创建由 DefaultDirName 设置的目录(以及将在其中存储卸载数据).或将 CreateAppDir 设置为no.尽管这会使Inno Setup将卸载信息存储到{win},但这不是很好.

In this case, make sure you set the installation directory to one of the selected custom directories, so that Inno Setup knows where to store uninstallation data to. Otherwise Inno Setup will still create the directory set by the DefaultDirName (and will store the uninstallation data there). Or set the CreateAppDir to no. Though that will make Inno Setup store uninstallation information to {win}, what is not nice.

有关完整的解决方案,请参阅
在文件"部分的自定义页面中使用两个/多个选定的目录.

For complete solution, see
Use two/multiple selected directories from custom page in Files section.

关于第二个问题:问题是您实际上是使用{pfXX}常量将文件安装到固定位置的程序文件".要安装到用户在选择目标位置"页面上选择的位置,您必须使用 {app}常量.

As for the second question: The problem is that you actually install the files to fixed location, the "program files", using the {pfXX} constants. To install to the location selected by the user on the "Select Destination Location" page, you have to use the {app} constant.

这篇关于Inno Setup:如何为“选择目标位置"页面指定多个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆