Remove item from Components

45 views
Skip to first unread message

Petr Šikola

unread,
May 9, 2025, 5:55:45 AM5/9/25
to innosetup
Hi, I would like to remove an item from a Components depending on the previous installation and other logic. I tried Check function on the component, but in the handler I cannot use WizardIsComponentSelected, nor ExpandConstant('{app}') nor WizardDirValue, because they do not exist yet. I tried to delete an item from WizardForm.ComponentsList in CurPageChanged for CurPageID = wpSelectComponents, but the application then crashes, probably because the corresponding items from ItemState of the TNewCheckListBox component are not deleted.
Is there any way, how to correctly remove items from Components or from TNewCheckListBox?

I know that I can disable the items (by WizardForm.ComponentsList.ItemEnabled), but I would like to hide/delete them, because then I do not have to solve another problem with full type selection there (it selects disabled items too).

Thanks.
Petr

Martijn Laan

unread,
May 9, 2025, 6:10:33 AM5/9/25
to innosetup
Have you considered using WizardForm.PrevAppDir in your Check function?

Greetings,
Martijn 

Op vr 9 mei , Petr Šikola <petrs...@gmail.com> schreef:
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/fc1646d0-64d2-4fc4-8d97-0effc0ff2d8cn%40googlegroups.com.

Petr Šikola

unread,
May 9, 2025, 6:39:05 AM5/9/25
to innosetup
I can't test it right now, but I think WizardForm is nil at the time Check for Components is called.

Petr

Dne pátek 9. května 2025 v 12:10:33 UTC+2 uživatel Martijn Laan napsal:

Petr Šikola

unread,
May 9, 2025, 7:58:50 AM5/9/25
to innosetup
I checked again and deleting the item in WizardForm.ComponentsList.Items.Delete(index) is fine, ItemState from TNewCheckListBox component is deleted correctly.
I edited the list of components in the CurPageChange handler.

The problem was then with the combobox types (above the components) and selecting a variant other than custom, which I solved by hiding the combobox types (I only put one type in the installer).
The list of components for type change is taken statically from Entries[seComponent], which I can't control.

So thanks for best installer.
Petr

Dne pátek 9. května 2025 v 12:39:05 UTC+2 uživatel Petr Šikola napsal:
Reply all
Reply to author
Forward
0 new messages