Why AI_CLEAN_RESOURCES_UNINSTALL is always 1? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

neaflo
Posts: 4
Joined: Mon May 10, 2010 7:20 pm

Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Hi,

I'm trying to cleanup some registry entries that are not registered with AI at installation time. I do it on uninstall sequence, with a function exported from a DLL, which is executed on "Commit with no impersonation". I want to perform this cleanup only if the user answers YES to the question: "Would you like to remove settings and temporary files?" - which is shown by AI on uninstallation. I suspect [AI_CLEAN_RESOURCES_UNINSTALL] is the property which stores the answer to this question because I've seen it used by the registry key removal wizard. As this DLL function won't have access to the MSI properties when it's executed (because of "Commit with no impersonation"), I pass the MSI properties needed by my function in CustomData as "[ALLUSERS]|[AI_CLEAN_RESOURCES_UNINSTALL]". All good, but the annoying problem I have is that regardless of user's answer to the above question, the property [AI_CLEAN_RESOURCES_UNINSTALL] is always passed to the DLL function with a value of 1, hence I can't rely on its value.

To sumarize:
1. Which is the property that stores the answer to the uninstallation question: "Would you like to remove settings and temporary files?"
2. If this property is indeed [AI_CLEAN_RESOURCES_UNINSTALL], then why it's always passed with a value of 1? Is it a bug in AI? Do I do anything wrong?

I'm using the latest Enterprise 7.6.1 version.

Thanks,
Florin Neamtu
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Hi Florin,

Not sure why you are encountering this behavior. Indeed that is the property controlling whether to perform the cleanup or not.
I am attaching a sample project that demonstrates this behavior:
- build
- install
- perform uninstall
- on the VerifyRemoveDlg click the custom made Verify button. It should spawn a new dialog only if the checkbox on the VerifyRemoveDlg is ticked.

Opening the .aip in Advanced Installer will reveal a NewDialog published event on the Verify button. It is conditioned using AI_CLEAN_RESOURCES_UNINSTALL.

I hope the sample I'm posting here will be a good reference for you. Let me know if it helped troubleshooting your issue.

Best regards,
Gabriel
Attachments
sample.aip
(14.47 KiB) Downloaded 459 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
neaflo
Posts: 4
Joined: Mon May 10, 2010 7:20 pm

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Thanks for reply.

I can confirm that your sample project works.

However, I was not talking about VerifyRemoveDlg dialog, but about the message box attached. This message box is shown when I use the "Uninstall Cleanup" wizard on the registry keys I need removed at uninstallation and set the option "Ask the user whether he wants to perform cleanup". At runtime, the message box is shown always when I uninstall the application from program shortcuts folder. I'd expect that the same property (AI_CLEAN_RESOURCES_UNINSTALL) stores the answer to this message box too; but it seem that this is not the case.

Is it another property?
Attachments
remove-settings.PNG
remove-settings.PNG (11.33 KiB) Viewed 7550 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Hi,

The value of the property "AI_CLEAN_RESOURCES_UNINSTALL" is stored in the MSI package and doesn't changes its value
depending on the user's answer, it will always have the same value when you launch the package.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
neaflo
Posts: 4
Joined: Mon May 10, 2010 7:20 pm

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

So which property stores the answer of the message box that I have attached? I point out again that this message box is shown ONLY on uninstall.

Thanks.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Hello,

That property is also set depending on the answer to that message box. However you must be careful to use it after the message box has been displayed. The message box is displayed right before the RemoveRegistryValues standard action, so I suggest any custom actions using the AI_CLEAN_RESOURCES_UNINSTALL property be put after that standard action.

Attached is another sample demonstrating the behavior.

I hope it helps,

Regards,
Gabriel
Attachments
sample.aip
(12.6 KiB) Downloaded 532 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
neaflo
Posts: 4
Joined: Mon May 10, 2010 7:20 pm

Re: Why AI_CLEAN_RESOURCES_UNINSTALL is always 1?

Yes, it did help.

Thanks a lot!

Return to “Common Problems”