Problems to attach a custom action to Uninstall - 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!

kruemel
Posts: 2
Joined: Wed Feb 10, 2010 7:40 pm

Problems to attach a custom action to Uninstall

Hello,

I have a trial version of the advanced installer to decide if I will purchase a license of the java edition.

Unfortunately I encountered problems while following the instructions of "How do I install a service for a custom user?"
I differed from the description only in the point, that I did not create two new properties but used a LogonInformationDlg and the properties USER_NAME and USER_PASSWORD instead.

It all works well until the point where the SeServiceLogonRight shall be revoked.
I followed the instructions and created an Attached custom action to Uninstall with these parameters:
Name: ntrights.exe_1
File: ntrights.exe
Command Line: -u [USER_NAME] -r SeServiceLogonRight
Immediate Execution
REMOVE="ALL"

When installing the Service, all goes well. When uninstalling, there is the following message:

There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.

I don't know where the problem lies and would be very thankful, if you could help me with this.

Thanks,

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

Re: Problems to attach a custom action to Uninstall

Hi Lena,

You can try running the uninstall with a log and look there when and what action fails.

Might I suggest you test the custom action not from the installer but from the command line with the proper parameters to ensure that it works and does what it's expected to do.
You can then check to see if USER_NAME has the expected value when executing the ntrights.exe_1 custom action. You can either look in the uninstall log or display a message box
using script inline custom action like this:
MsgBox(Session.Property("USER_NAME"))

Let me know if you can not find the issue and I will gladly assist.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
kruemel
Posts: 2
Joined: Wed Feb 10, 2010 7:40 pm

Re: Problems to attach a custom action to Uninstall

Hello Gabriel,

Thanks for your answer.

I checked with message boxes the value of USER_NAME and at the uninstall action the value is empty, at install the value is as expected and the right is set correctly.
I started another attempt where I hardcoded the username and password in a property and this worked.

I don't know why or where the value of USER_NAME is deleted. Maybe I can transfer the value of USER_NAME in a new property and use this property in the uninstall custom action. Ijust don't know how to transfer the value and how to make sure the value won't be deleted.

Thanks

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

Re: Problems to attach a custom action to Uninstall

Hi Lena,

I am not sure what you are doing. But it appears to me you are setting a property on install then use it during uninstall. Property values are NOT preserved between install and uninstall. You will need to save USER_NAME's value in the registry or somewhere else during install, then restore it during uninstall using a search or some other means.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”