Running custom action as normal user on uninstallation - Advanced Installer Community
abh3
Posts: 4
Joined: Tue Jun 11, 2013 4:19 am

Running custom action as normal user on uninstallation

Hi AdvancedInstaller team

I'm trying to run a custom action on the uninstallation stage.
But I need it to run as normal user, not the elevated one. So it has to be run before uninstaller prompts UAC.
So far as I know, If I put the custom action before the Path Resolution at Install Execution Stage, it will not work.
And If I put the custom action after the Preparing at Install Execution Stage, it will prompt UAC first.
So I concluded, I need to put it in between Path Resolution and Preparing.
It works if I run the .msi file directly, but it fails if I run it under this command:
msiexec /quiet APPDIR="<Custom Directory>" /i "<Msi File>"

Do you know any workaround so I can run a custom action as normal user on the uninstallation?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Running custom action as normal user on uninstallation

Hi Abraham,

Please keep in mind our response time is the same if you post several times and/or if you send e-mails. We do prioritize urgent matters depending on the in progress work load, but our recommendation is to start a single topic either on forums or e-mail.

The UAC is shown during Preparing -> InstallInitialize standard action. All custom actions you schedule before are immediate and cannot run elevated unless they have that functionality embedded (e.g. "Launch file" predefined custom action has the "Run as admin" flag).

Is the shell you're running the silent command line from elevated? Also, it's not clear to me, does the whole installation fail or is it just the custom action? Does it work when using /qb switch instead of /quiet?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
abh3
Posts: 4
Joined: Tue Jun 11, 2013 4:19 am

Re: Running custom action as normal user on uninstallation

Actually the problem lies in the uninstallation process.
It should be like this:
1. User run uninstall shortcut or uninstall through Control Panel
2. Then the uninstaller should pop up a dialog, asking whether user wants to remove the local data as well or not
3. If user wants to remove local data, then it should run the app with some argument, for example "[MyApp.exe] removedata", to remove the data.
The point is, It should be able to run without elevated, so it can delete the local data that's located in the current user app data. (C:/Users/<Username>/AppData/AppDirectory/) If it is run with elevated, it will delete the local data that's located in the admin app data instead of the current user app data.
4. Then after finish processing, it should run the uninstallation process like usual.

I arranged the custom actions for the uninstallation, so it will run a custom action between Path Resolution and Preparing on Install Execution Stage, that's calling "[MyApp.exe] uninstall" (and this will show the data removal dialog). With this configuration, if I install using .msi directly, the uninstallation will work the way I want it to be. But if I install using bootstrapper that I made, the uninstallation will shows UAC first before the data removal dialog shows up, and makes the data removal process elevated.

Is there any other way I could make uninstallation process to be like that with AdvancedInstaller?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Running custom action as normal user on uninstallation

Hi there,

The .EXE bootstrapper can have its own embedded elevation manifest depending on the options from Install Parameters page. This elevation is performed right after double click.

Can you send us your resources to support at advancedinstaller dot com so we can investigate them?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”