InnoSetup, change the Uninstallable property behavior at runtime?

后端 未结 1 1522
礼貌的吻别
礼貌的吻别 2021-01-16 04:00

SCENARIO

I have created an installer that will installs a Malware application for educative purposes, the installer contains these two t

相关标签:
1条回答
  • 2021-01-16 04:41

    You can use the code shown in the Uninstallable directive documentation:

    [Setup]
    ...
    Uninstallable=not IsTaskSelected('hidden')
    
    [Tasks]
    Name: hidden; Description: Hidden mode; GroupDescription: Installation Mode
    Name: visible; Description: Visible mode; GroupDescription: Installation Mode
    

    Optionally, if you'd need more complex statements written in reusable function, or access some of the scripting code elements, you could write a function, e.g.:

    [Setup]
    ...
    Uninstallable=IsUninstallable
    
    [Tasks]
    Name: hidden; Description: Hidden mode; GroupDescription: Installation Mode
    Name: visible; Description: Visible mode; GroupDescription: Installation Mode
    
    [Code]
    function IsUninstallable: Boolean;
    begin
      Result := WizardSilent or not IsTaskSelected('hidden');
    end;
    
    0 讨论(0)
提交回复
热议问题