2

I know that the directive ArchitecturesInstallIn64BitMode=x64 ia64 can be set, so that Inno Setup will decide on the processor type and install in 64 bit if its possible.

But I need some [Code] section function to set the install mode (32 or 64).

Is it even possible?

Example:

This function will return the Java installation architecture (32 or 64):

function CheckJavaInstallation()

According to the result I want to set Inno Setup to the correct install mode -> Selection of the correct Program Files or Program files (x86) and in the correct registry (normal or WOW6432Node).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Charlie Brown
  • 173
  • 4
  • 12
  • Can you post an example of what you are trying to accomplish? I'm not sure I understand what you are trying to do and what your goal is. – mirtheil Mar 20 '12 at 14:07
  • I elaborated the question a little bit. – Charlie Brown Mar 20 '12 at 14:15
  • This is a question that should be directed towards the developers of Inno Setup. What you are asking is if its possible to create a single setup file that supports both platforms. Honestly I only know of one setup solution program that supports doing that and its not Inno Setup. – Security Hound Mar 20 '12 at 14:33
  • Actually its possible to support more than one platform with a single setup file in inno setup: http://stackoverflow.com/questions/4833831/inno-setup-32bit-and-64bit-in-one/4837304#4837304 But I need to determine the install mode by myself, not by inno setup. – Charlie Brown Mar 20 '12 at 14:36

2 Answers2

5

I would suggest you to create two checker functions: IsJava32 and IsJava64. Then for every file, registry entry, etc you add the two versions with one of the checkers, example:

[Files]
Source: "SourceSetupDir32\aFile1.dll"; DestDir: "{pf32}\{#MyAppName}\"; Check: IsJava32;
Source: "SourceSetupDir64\aFile1.dll"; DestDir: "{pf64}\{#MyAppName}\"; Check: IsJava64;
;...
Source: "SourceSetupDir32\aFile4.dll"; DestDir: "{pf32}\{#MyAppName}\"; Check: IsJava32;
Source: "SourceSetupDir64\aFile4.dll"; DestDir: "{pf64}\{#MyAppName}\"; Check: IsJava64;

[Registry]
Root: HKCU32; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty; Check: IsJava32;
Root: HKCU64; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty; Check: IsJava64;
[Code]

Function IsJava32(): Boolean;
Begin
  { ... }
End;

Function IsJava64(): Boolean;
Begin
  Result := Not IsJava32;
End;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
az01
  • 1,988
  • 13
  • 27
0

A simpler solution can be find here. For those that are searching for an answer to this question.

Community
  • 1
  • 1
Jon49
  • 4,444
  • 4
  • 36
  • 73