tags:

views:

51

answers:

1

I'm using Inno Setup with two components: one for 32-bit machines and one for 64-bit. These will run on XP/Vista/Win7.

[Components]
Name: Bin/32; Description: 32-bit; Types: full; Flags: dontinheritcheck
Name: Bin/64; Description: 64-bit; Types: full; Flags: dontinheritcheck

Currently:

  • Both Components are ticked by default when running the installer.

What I want is:

  • An appropriate default (i.e. either 32-bit or 64-bit ticked) depending on the user's machine.
  • Greying out the inappropriate Component would be a bonus too.

What I've found so far is:

  • That I probably want to use Pascal in the [Code] section.
  • The IsWin64 function
  • That I might want to use an Event for this, but I can't find anything related to my needs yet.

P.S. Unfortunately I'm not able to have separate installers per architecture.

+2  A: 

you can check the C:\Program Files\Inno Setup 5\Examples folder for examples about how install a program for different architectures using a single installer.

check these files

  • 64BitThreeArch.iss
  • 64BitTwoArch.iss
  • 64Bit.iss

you can use something like this

[Components]
Name: Bin_32; Description: 32-bit; Types: full; Check: IsX86; Flags: dontinheritcheck
Name: Bin_64; Description: 64-bit; Types: full; Check: IsX64; Flags: dontinheritcheck

[Code]
function IsX64: Boolean;
begin
  Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
end;

function IsX86: Boolean;
begin
  Result := (Is64BitInstallMode=false) and (ProcessorArchitecture = paX86);
end;
RRUZ
Thanks for leading me the Examples folder.Unfortunately that doesn't work for me as that's switching on a per-file basis; I'm looking for a per-component basis. Like some sort of 'Check' functionality for Components maybe.
Nockm
check the updated answer
RRUZ
It appears that Check does work in the [Components] section
Nockm
@Nockm, the `Check` works in the [Components] section
RRUZ
Thanks. I had to add the following in the [Setup] to make it work: ArchitecturesInstallIn64BitMode=x64 ia64
Nockm