0

So here is my final issue I have been thinking about.

This is my Tasks window:

Tasks Window

Script:

Name: register32; Description: "Meeting Schedule Assistant (32 bit)"; GroupDescription: "{cm:FileAssociations}"; flags: unchecked exclusive;
Name: register64; Description: "Meeting Schedule Assistant (64 bit)"; GroupDescription: "{cm:FileAssociations}"; Check: IsWin64; Flags: exclusive; 

I don't know if this is possible (and taking into account the customizations here). If the user is running 32 bit Windows, then we we only have one option to display. If it is just one option, can we turn it into a check box?

Does that make sense? So the two radios for when we can choose 32 / 64 and the single check for when it can oply be 32.

Update

As per the comments, I have adjusted the tasks like this:

Name: register32; Description: "Meeting Schedule Assistant (32 bit)"; GroupDescription: "{cm:FileAssociations}"; Check: IsWin64; flags: unchecked exclusive;
Name: register64; Description: "Meeting Schedule Assistant (64 bit)"; GroupDescription: "{cm:FileAssociations}"; Check: IsWin64; Flags: exclusive; 

So now the two radio options are only displays on computers that can run 32 and 64 bit software. This means we must change the following code which is used when creating the registry entries:

[Code]
function GetExecutableToRegister(Param: string): string;
begin
  if IsWin64 and WizardIsTaskSelected('register64') then
    Result := 'MeetSchedAssist_x64.exe'
  else
    Result := 'MeetSchedAssist.exe';
end;

It needs changing:

if only 32 bit
  return 32 bit name
else if only 64 bit
  return 64 bit name
else
   return the name from the task that was selected

So what changes are needed to the code for that logic?

Community
  • 1
  • 1
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • 1
    My [original code](https://stackoverflow.com/q/61667026/850848#61667861) suggested that you use `IsWin64` for both. Then no radio buttons will show on 32-bit and the code will default to 32-bit registration (see `GetExecutableToRegister`). That's consistent with your radio buttons for 64-bit installation, which also do not allow you to skip registration on 64-bit. If you want to allow the user to skip the registration, you should allow that for 64-bit version too. – Martin Prikryl May 11 '20 at 12:54
  • @MartinPrikryl I understand you now. So if the pc is just 32 bit or just 64 bit it will register anyway. But if it can be 32/64 it will show radios to choose. I will put that check back in. – Andrew Truckle May 11 '20 at 13:31
  • @MartinPrikryl Hhm. OK, so I have added `IsWin64` can in but that `GetExecutableToRegister` needs changing doesn't. If PC is only 32 bit then register `MeetSchedAssist.exe`, if only 64 bit, then register `MeetSchedAssist_x64.exe`, else register the option chosen by the user. What changes do we need for that? Do I add that original code to my question? – Andrew Truckle May 11 '20 at 13:47
  • By *"if only 64 bit"*, do you mean, if uses choses to install only 64-bit version of the application? – How do you do that? Tasks/Components? – Martin Prikryl May 11 '20 at 14:27
  • @MartinPrikryl No, I do not mean that. Perhaps what I am saying is not possible. If a PC is running 64 bit O/S then does that mean by design that they will ALWAYS be able to run both 32 AND 64? In which case what we have is fine as it is. – Andrew Truckle May 11 '20 at 14:29
  • 1
    Afaik, it is technically possible to remove 32-bit support from a 64-bit Windows system, but it's very rarely done. Mostly on bare-bone server-only installations. I've actually never seen a machine like that. – Martin Prikryl May 11 '20 at 14:31
  • 1
    @MartinPrikryl Ok, so what we now have is fine. 32 bit PC will not show any options to the user because it will register anyway. Only on 64 bit will they see the radios, and it will default to last active registered exe. I think we will be OK now. :) – Andrew Truckle May 11 '20 at 14:34

0 Answers0