3

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.

My [Files] section is as follows:

[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

  • Firstly, it only let's me override the pf32 path
  • Secondly, nothing gets installed if I override the install directory

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?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
j b
  • 5,147
  • 5
  • 41
  • 60

1 Answers1

2

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

For examples see:


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.

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.


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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992