InnoSetup, change the Uninstallable property behavior at runtime?

不想你离开。 提交于 2019-12-01 13:05:58

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;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!