Inno Setup Set. Uninstallable directive based on user flag.

I want to know how to use the Uninstallable directive when I have no tasks or components:

 [Setup] Uninstallable:not if IscomponentSelected ('comp1 comp2') 

I have no tasks or components. I created several checkboxes with a โ€œportableโ€ option, which I want to add the uninstallable option when this checkbox is selected:

 [Code] var Component: TWizardPage; portable,installer: TNewRadioButton; Copmp: TLabel; function install: Boolean; begin Result := installer.Checked; end; function portab: Boolean; begin Result := portable.Checked; end; procedure InitializeWizard(); begin Component := CreateCustomPage( wpSelectDir, 'Component Selection', 'Which types and components would you like to install?'); CompPanel := TPanel.Create(WizardForm); with CompPanel do begin Parent := Component.Surface; Left := ScaleX(0); Top := ScaleY(0); Width := ScaleX(417); Height := ScaleY(100); BevelOuter := bvNone; end; Copmp := TLabel.Create(WizardForm); with Copmp do begin Parent := CompPanel; Caption := 'Type and components:'; Left := ScaleX(0); Top := ScaleY(5); Width := ScaleX(150); Height := ScaleY(13); end; portable := TNewRadioButton.Create(WizardForm); with portable do begin Parent := CompPanel; Left := ScaleX(5); Top := ScaleY(25); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Unpacking'; OnClick: =@CopmpClick ; end; installer := TNewRadioButton.Create(WizardForm); with installer do begin Parent := CompPanel; Left := ScaleX(5); Top := ScaleY(45); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Install'; OnClick: =@CopmpClick ; Checked:=True; end; 
+1
source share
1 answer

Just do the custom function:

 function IsUninstallable: Boolean; begin Result := installer.Checked; end; 

And use it in the Uninstallable directive:

 [Setup] Uninstallable=IsUninstallable 
+1
source

Source: https://habr.com/ru/post/974819/


All Articles