bkimp
Posts: 4
Joined: Thu Jan 07, 2010 8:39 pm

Prevent recreation of Useraccounts while upgrading

Hi,

We've made a setup wich contains following tasks:
- Creating an Account on the local machine (Using the Users and Groups feature of the installer)
- Configuring the neccesary privileges for the Account (Using ntrights.exe as attached custom action)
- Installing a windows service using the login credentials of the previously created account (Using the Services feature of the installer)
- Starting the service

The problem is, that the account is deleted and recreated (resulting in a new user profile directory) each time the user installs an upgrade. I've already tried to set the condition "(NOT ((OLDPRODUCTS) OR (UPGRADINGPRODUCTCODE)))" to the standard custom action "RegisterUser", but this seems not to work.

Has someone an idea how to prevent this effect?


Greetings

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

Re: Prevent recreation of Useraccounts while upgrading

Hi Bastian,

On the Users and Groups page, select the user and go to the Install Condition section found lower on the pane. Set your condition there.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
bkimp
Posts: 4
Joined: Thu Jan 07, 2010 8:39 pm

Re: Prevent recreation of Useraccounts while upgrading

Hi Gabriel,

thank you for your answer! I've installed the new Release (I previously worked with 7.3.1) of the advanced installer and tried your suggestion, but it seems not to work as intended.

I tried the following scenario (both setup versions contain the condition):
1. I installed Version 1.0.46 on a clean vmware (Setup works as intended, user is installed and rights are configured)
2. I installed Version 1.0.47 over 1.0.46 and got an installation error. The installer displayed a message, informing me that he was unable to install the service, because the login informations are incorrect. I looked into the userlist of the system and saw, that the serviceaccount has been deleted (= The condition prevented the recreation of the account but not it's deletion).

Any ideas, what I'm doing wrong?

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

Re: Prevent recreation of Useraccounts while upgrading

Hello again,

Hmm, send the two .aip project files to support at advancedinstaller dot com so we can have a look at them.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Prevent recreation of Useraccounts while upgrading

Hello,

It appears my suggestion was incorrect, sorry about that. Upon further study, we have found the behavior you are encountering is due to a limitation in the current way this feature is implemented. We will add support to prevent this in a future version of Advanced Installer. In the meantime you can use the new Table Editor to make an adjustment so this behavior can be prevented:
- select the InstallExecuteSequence table and find the AI_UninstallAccounts custom action. Make sure the condition looks something like:

Code: Select all

VersionNT AND (REMOVE = "ALL") AND (NOT UPGRADINGPRODUCTCODE)
This will prevent the removal of all created accounts if your product is being upgraded.
Please let me know how this works for you.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
bkimp
Posts: 4
Joined: Thu Jan 07, 2010 8:39 pm

Re: Prevent recreation of Useraccounts while upgrading

Hi Gabriel,

your second suggestion has helped me. The setup seems to work now as intended (First install creates the account, upgrades don't touch it and the final uninstallation removes the whole software including security configuration and service account).

Thank you very much for your help!


Greetings from Germany

Bastian

Return to “Common Problems”