When I checked the start menu shortcut creator checkbox, I realized that the shortcut is not created inside the programs folder of the start menu. However it was created when I checked the desktop shortcut creator checkbox. So I fixed it like this:
Code:
//#if !CompactMode || !UpdateMode
// function CreateIconsDesktop: Boolean;
// begin
// Result := (not IsDoneError) and IconsCB.Checked;
// end;
// function IsUninstallable: Boolean;
// begin
// Result := UninstallCB.Checked;
// end;
//#endif
//#if !CompactMode
//function CreateIconsStartMenu: Boolean;
//begin
// Result := (not IsDoneError) and (not StartMenuCB.Checked);
//end;
//#endif
function CreateIconsDesktop: Boolean;
begin
Result := (not IsDoneError) and Assigned(IconsCB) and IconsCB.Checked; // your “desktop shortcut” checkbox
end;
function CreateIconsStartMenu: Boolean;
begin
Result := (not IsDoneError) and Assigned(StartMenuCB) and StartMenuCB.Checked;
end;
function IsUninstallable: Boolean;
begin
Result := Assigned(UninstallCB) and UninstallCB.Checked;
end;
procedure StartMenuCBClick(Sender: TObject);
var
CB: TNewCheckBox;
begin
if (Sender is TNewCheckBox) then CB := TNewCheckBox(Sender) else CB := StartMenuCB;
if Assigned(WizardForm) and Assigned(CB) then
begin
WizardForm.GroupEdit.Enabled := CB.Checked;
WizardForm.GroupBrowseButton.Enabled := CB.Checked;
end;
end;
Then called it inside the
Code:
StartMenuCB := TNewCheckBox.Create(WizardForm);
like this:
Code:
Checked := False; // 1) set default state
OnClick := @StartMenuCBClick; // 2) wire the handler
StartMenuCBClick(StartMenuCB); // 3) Synchronize the UI to the current checkbox state
end;
I don't know if anyone has experienced this bug but here is my solution nevertheless!