Hello,
First of all, regarding this:
4) From the image above if the user does an install and that check box is not selected it wont install it , But if they run the setup again and do a MODIFY, if they select the check box it should install the .exe , it doesnt and i cant see why would that happen ?
Here is how you could proceed to achieve that:
- create a new dialog and add your checkbox to it
- also add the dialog in
"Dialogs" page --> under
"Maintenance"
- on the
"Next" button of the dialog, under
"Published Events" add two events:
- UninstallInstallFeature.png (27.13 KiB) Viewed 4773 times
One event that will change the feature state to
"Install" if the checkbox
is checked and one that will change the feature state to
"Uninstall" if the checkbox
is not checked.
Regarding the shared resources, a component is shared between multiple setups when:
- the component uses the same name and the same GUID in all packages. Most of the time, this happens when you are using the same .AIP to create another package that is similar to the one you already have.
For instance, if you have a package and want to create a brand new one which just contains one more file than the previous, you copy the .AIP file and create the new package from that. When doing this, you will end up with two packages having the exact same components + GUIDS, resulting in shared components.
Please note that this is not recommended, the reason being the one presented above. If you want to achieve something similar with what I have described above, you can use the
"Save as Template" option.
- the file is installed in the same location by all packages
This way, Windows Installer will see the component as shared between packages and it will use a reference count for it. Installing a package with the shared component will increase the reference count and uninstalling one will decrease the reference count. The component is removed when the last package which contains it is uninstalled (the reference count reaches 0).
If the files are somehow shared between multiple setups, how can i check this ?
Like most things on Windows, these are saved in the registry. For instance, I have recreated this behavior by doing what I have mentioned above (created two projects from the same .AIP) --> both containing the same EXE file, whose component had the same GUID in both projects:
- SharedComponent.png (155.83 KiB) Viewed 4773 times
As you can see above, the component having the packed GUID
{772FEACF7B87F0841BC3462A4A99AA8B} is shared between two setups.
The component has the following GUID in my project:
- GUID.png (40.32 KiB) Viewed 4773 times
while its' Packed GUID is:
- PackedGUID.png (12.04 KiB) Viewed 4773 times
The concept of a Packed GUID is explained in the
"Why files are left behind after package uninstall?" FAQ I have linked above.
Hope this helps!
Best regards,
Catalin