I'm trying to make my setup stop when all components are already install.
Installation Example :
- First Install : one component install
- Second Install : install the rest of component
- Third install : setup begin and go directly to
wpFinishedpage or stop and put a message saying "all component are already install".
I've make some research here and on other website and I have do the following :
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm := False;
end;
procedure InitializeWizard;
var
ItemIndex: Integer;
InstallEn: String;
InstallFr: String;
InstallDe: String;
CompDescEnIndex: Integer;
CompDescFrIndex: Integer;
CompDescDeIndex: Integer;
Check: Integer;
begin
# This part is to make not selectable component already install
if RegQueryStringValue(HKLM, 'Software\COMPANY\{#RegProduct}\{#RegCurVer}', 'Install-ENG', InstallEn) then
if ((InstallEn = 'International Pack' )
or (InstallEn = 'Pack International')
or (InstallEn = 'International Paket'))
then
ItemIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescEn'));
WizardForm.ComponentsList.ItemEnabled[ItemIndex] := False;
if RegQueryStringValue(HKLM, 'Software\COMPANY\{#RegProduct}\{#RegCurVer}', 'Install-FRA', InstallFr) then
if ((InstallFr = 'French Pack')
or (InstallFr = 'Pack France')
or (InstallFr = 'Franzosisch Paket'))
then
ItemIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescFr'));
WizardForm.ComponentsList.ItemEnabled[ItemIndex] := False;
if RegQueryStringValue(HKLM, 'Software\COMPANY\{#RegProduct}\{#RegCurVer}', 'Install-DEU', InstallDe) then
if ((InstallDe = 'German Pack')
or (InstallDe = 'Pack Allemand')
or (InstallDe = 'Deutsches Paket'))
then
ItemIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescDe'));
WizardForm.ComponentsList.ItemEnabled[ItemIndex] := False;
# After I try to say if all component are install, close the wizard.
CompDescEnIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescEn'));
CompDescFrIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescFr'));
CompDescDeIndex := WizardForm.ComponentsList.Items.IndexOf(CustomMessage('CompDescDe'));
if not WizardForm.ComponentsList.ItemEnabled[CompDescEnIndex]
and not WizardForm.ComponentsList.ItemEnabled[CompDescFrIndex]
and not WizardForm.ComponentsList.ItemEnabled[CompDescDeIndex]
then
Check := 1;
if (Check <> 0) then
WizardForm.Close;
end;
Note: Code may not be very clean, I started in Pascal + Inno Setup in the Code section.
If all my component are installed (and not selectable), I want the wizard to stop and not continue...
I can't find a solution to go directly at wpFinished page... Is there a way to do that?
How can I stop the wizard if all component are installed because WizardForm.Close; seems not work in my case?
Thanks for help.
