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!

Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Software replacment

I'm replacing some software on our client PC's.What is the best way for me to complete an msi installation and then follow it up by stopping some services and uninstalling 3-4 msi's. this may be a strange concept and may not be possible to do...
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Software replacment

Hi and welcome to Advanced Installer forums.

The recommended way to achieve this, is to go in the "Upgrades" page, use the [Upgrade] toolbar button and add the Upgrade Codes of the MSI packages that you want to be uninstalled (you can simply select those MSI's). However in this case the MSI's will be removed before the installation of the new MSI package.

If you want them to be uninstalled after the installation of your MSI package, you can go in the "Custom Actions" page, add a "Configure MSI with specific Product Code" custom action on the "Finish Dialogs Stage" section for each of your MSI's to be uninstalled and add the "/x" argument in the "Command Line" field.

In order to stop the services, you can go in the "Services" page and add a new "Control Operation" for each service that you want to stop, then write their name in the "Service name" field.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Re: Software replacment

Thanks for that. looking at the Custom Actions and selecting "Configure MSI with specific ProductCode" requires me to select a file to execute as a custom action. i want to complete the un-installation using a Product Code (i don't have access to the installer msi directly.)
Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Re: Software replacment

Also if I do select a MSi file. if I enter /x into the command line option how do I also add "/qn /L*v %windir%\Temp\%computername%Uninstall_RMS9-10_Log.txt" to the end.

for example the command I would like to run is

MsiExec.exe /X {FED1005D-CBC8-45D5-A288-FFC7BB304121} /qn /L*v %windir%\Temp\%computername%Uninstall_RMS9-10_Log.txt
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Software replacment

Hi,
Thanks for that. looking at the Custom Actions and selecting "Configure MSI with specific ProductCode" requires me to select a file to execute as a custom action. i want to complete the un-installation using a Product Code (i don't have access to the installer msi directly.)
You're welcome. The custom action prompts you to choose the MSI package only to automatically extract the Product Code from it, but the MSI package will not be used by the custom action during the installation.
Also if I do select a MSi file. if I enter /x into the command line option how do I also add "/qn /L*v %windir%\Temp\%computername%Uninstall_RMS9-10_Log.txt" to the end.

for example the command I would like to run is

MsiExec.exe /X {FED1005D-CBC8-45D5-A288-FFC7BB304121} /qn /L*v %windir%\Temp\%computername%Uninstall_RMS9-10_Log.txt
To achieve this, you can use the "Launch file" predefined custom action with the following configuration (as displayed in the image below):
  • File To Launch: msiexec.exe
    Command Line: /x {0589850F-1B5D-480D-8FC7-56B0AEA4CA8D} /qn /L*V "[%windir]\Temp\[%computername]log.txt"
However, please keep in mind that in order to uninstall an MSI in silent mode (/qn), it needs administrator rights, so you need to check the "Run as Administrator" option for the custom actions.

Best regards,
Eusebiu
Attachments
Uninstall MSI Custom Action.png
Uninstall MSI Custom Action.png (8.67 KiB) Viewed 5444 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Re: Software replacment

Thanks, that makes sense.

finally im assuming that requiring administrator rights would be overlooked if the installation is deployed running as SYSTEM
Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Re: Software replacment

And also the execution time should be set to "after the system has been successfully Modified (Commit)" for the "Launch File" execution to be completed at the end
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Software replacment

Hi,
finally im assuming that requiring administrator rights would be overlooked if the installation is deployed running as SYSTEM
Yes, if the MSI is deployed under the "System" account it will have administrator rights which will be inherited by the custom actions.
And also the execution time should be set to "after the system has been successfully Modified (Commit)" for the "Launch File" execution to be completed at the end
Yes, this should be the execution time. However, please note that if you have more custom actions set to be executed at that point, the uninstallation of the MSIs will be started at the same time, but Windows Installer does not permit two MSI's to be installed/uninstalled at the same time and your custom action will fail.

Also, the custom actions should not be placed on the "Install Execution Stage" section because, in this case, they will interfere with the installation of the main MSI and fail, too.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mbrincat
Posts: 9
Joined: Wed Dec 03, 2014 5:45 pm

Re: Software replacment

how would you suggest running multiple msiexec uninstallers for multiple custom actions?

Also when building the package i recieve this error.

Checking builds status... done.
Build required.

[ DefaultBuild ]
Building package (en): C:\Applicationfolder\Applicationname.msi
Copying file(s)... done.
Creating MSI database... error.
Error calling MSI API: 1627 Method: MsiDatabaseImport Table: CreateFolder. Extended Error: 1: 2216 2: C:\Applicationfolder\Applicationname.$.msi 3: CreateFolder.idt 4: 129 .

Build finished because an error was encountered.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Software replacment

how would you suggest running multiple msiexec uninstallers for multiple custom actions?
To achieve this, you can create a BAT file that uninstalls multiple MSI's, then run it in a "Launch File" custom action that is placed after the "Install Execution Stage -> Finish Execution" action group with the configuration below::
  • File To Launch: [#YourBat.bat]
    Check "Hide program's window" option
    (the CMD window will not be displayed when the BAT file will be executed)
    Uncheck the "Wait for custom action to finish before proceeding" and "Wait for return code at the end of the sequence" options
    Execution Stage Condition: check only "Install"
Also when building the package i recieve this error.

Checking builds status... done.
Build required.

[ DefaultBuild ]
Building package (en): C:\Applicationfolder\Applicationname.msi
Copying file(s)... done.
Creating MSI database... error.
Error calling MSI API: 1627 Method: MsiDatabaseImport Table: CreateFolder. Extended Error: 1: 2216 2: C:\Applicationfolder\Applicationname.$.msi 3: CreateFolder.idt 4: 129 .

Build finished because an error was encountered.
You can see my response on the Error calling MSI API: 1627 thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”