Installation 如果已经安装了其他组件,则不要让用户安装特定组件

Installation 如果已经安装了其他组件,则不要让用户安装特定组件,installation,inno-setup,Installation,Inno Setup,InnoSetup非常新,但我找不到任何关于这方面的文档。我想实现一个条件,如果用户已经安装了一个特定的组件,它将不允许他们安装另一个特定的组件 例如:如果Bob以前安装过ComponentA,并绑定到安装ComponentB,则会出现一条警告“当前安装ComponentA时无法安装ComponentB” 这就是我到目前为止的想法: 过程CurPageChanged(CurPageID:Integer); 变量 值:字符串; 卸载键:字符串; 开始 卸载密钥:=“软件\Microsoft\Win

InnoSetup非常新,但我找不到任何关于这方面的文档。我想实现一个条件,如果用户已经安装了一个特定的组件,它将不允许他们安装另一个特定的组件

例如:如果Bob以前安装过ComponentA,并绑定到安装ComponentB,则会出现一条警告“当前安装ComponentA时无法安装ComponentB”

这就是我到目前为止的想法:

过程CurPageChanged(CurPageID:Integer);
变量
值:字符串;
卸载键:字符串;
开始
卸载密钥:=“软件\Microsoft\Windows\CurrentVersion\Uninstall”+
ExpandConstant(“{#SetupSetting(“AppId”)}”)+“_is1”;
结果:=(RegQueryStringValue(HKLM,UninstallKey,'Inno Setup:Selected Components',值)或
RegQueryStringValue(HKCU,UninstallKey,'Inno Setup:Selected Components',值)和(值“”);
如果CurPageID=wpSelectComponents,则
如果结果=WizardForm.ComponentsList.ItemCaption[1],则
开始
WizardForm.ComponentList.Checked[1]:=False;
WizardForm.ComponentsList.ItemEnabled[1]:=True;
WizardForm.ComponentList.Checked[2]:=False;
WizardForm.ComponentsList.ItemEnabled[2]:=False;
WizardForm.ComponentList.Checked[3]:=False;
WizardForm.ComponentsList.Enabled[3]:=True;
结束;
结束;
结束;

我知道,对于所选组件,我的注册表查询并不完全正确。。但我觉得我很接近。问题是,结果可能包含多个组件。比如(苹果、橘子、芒果),但如果“芒果”只是存在的话,我希望这句话仍然是真的。

你认为你可以用另一种方式做到这一点:

使用标志:
独家

例如:

[Types]
Name: "full"; Description: "Full"; Flags: iscustom

[Components]
Name: "connect"; Description: "Mainsection"; Types: "full" ;Flags: fixed
Name: "connect\compA"; Description: "ComponentA"; Types: "full"; Flags: exclusive
Name: "connect\compB"; Description: "ComponentB"; Flags: exclusive

[Files]
Source: "srcpath"; DestDir: "dirpath"; Components: connect\compA
Source: "srcpath"; DestDir: "dirpath"; Components: connect\compB
[InstallDelete]
Type: filesandordirs; Name: "dirpath\compA"; Components: connect\compB;
Type: filesandordirs; Name: "dirpath\compB"; Components: connect\compA;


因此,如果“Bob”想要选择componenB,他不能在没有自动取消选择componentB的情况下使用ComponentA

因此,如果“Bob”已经安装了ComponentA,并且想要安装ComponentB,而您不想同时安装这两个组件,则需要使用
installdelete

例如:

[Types]
Name: "full"; Description: "Full"; Flags: iscustom

[Components]
Name: "connect"; Description: "Mainsection"; Types: "full" ;Flags: fixed
Name: "connect\compA"; Description: "ComponentA"; Types: "full"; Flags: exclusive
Name: "connect\compB"; Description: "ComponentB"; Flags: exclusive

[Files]
Source: "srcpath"; DestDir: "dirpath"; Components: connect\compA
Source: "srcpath"; DestDir: "dirpath"; Components: connect\compB
[InstallDelete]
Type: filesandordirs; Name: "dirpath\compA"; Components: connect\compB;
Type: filesandordirs; Name: "dirpath\compB"; Components: connect\compA;

我希望这将有助于Inno在注册表的卸载项中存储有关已安装组件的信息。您可以在安装过程中阅读这些信息,然后通过代码部分禁用特定组件。谢谢,我根据您的建议进行了编辑。我不确定这行:
如果Result=WizardForm.ComponentsList.ItemCaption[1],那么
是否正确。有什么想法吗?