IB85lb
Posts: 27
Joined: Tue Oct 12, 2010 10:02 am

creating custom action that uninstall an APP plz help

hi
we create old installer for our application by advance installer7.7 enterprise created by old team now we are new team and we create new installer with new path direction different than the old but the problem is the customers who installed the old installer when they upgrade to the new installer upgrade not work it install the new one in different place .so we replace the path with old path the upgrade worked but we run the application didnot work .
my question is how i can make condition in custom action that search in registry for the old one and install it automatically before installing the new one.
or if there is a new idea can u gave it .


Best Regards
IB85lb
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: creating custom action that uninstall an APP plz help

Hello,

To solve this, please go to the Upgrades page and add the upgrade code of your previous version. This will enable the new version of your application to automatically remove the previous version before installing.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
IB85lb
Posts: 27
Joined: Tue Oct 12, 2010 10:02 am

Re: creating custom action that uninstall an APP plz help

since the path direction different than the previous one??
bec it did not work with different path, when they have the same path not all the application removed .
for that i want to reinstall all application before installing the new one.

i think i found the solution is if i create a search application that search for the product ID when it found it it run script.vbs that uninstall the previous product
but when i run the application an error message appears "there is a problem with this installer package. A script required for this install to complete could note be run contact your support personal or package vendor "
i will attach my script if any body can told where the problem to know that the application run normally without the advance installer.

Code: Select all

Const ProductCode = "{00000000-0000-0000-0000-000000000000}" 'Enter Product Code of MSI to uninstall



Const msiUILevelBasic = 3			

'Add UI level options below to options above as needed, they won't work just by themselves
Const msiUILevelHideCancel = 32		'!
Const msiUILevelProgressOnly = 64	'-
Const msiUILevelEndDialog = 128		'+

'Define MSI Installation states as constants for clarity

Const msiInstallStateAbsent = 2 	'The product is installed for a different user.

'Create Windows Installer Object
Set Installer = CreateObject("WindowsInstaller.Installer")


Installer.UILevel = msiUILevelBasic + msiUILevelHideCancel

If Installer.ProductState(ProductCode) <> msiInstallStateUnknown Then 	
  Installer.ConfigureProduct ProductCode, 0, msiInstallStateAbsent	
End If


Best Regards
IB85lb
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: creating custom action that uninstall an APP plz help

Hi,

As I said in my previous post, all you need to do is point your new Advanced Installer project to your old MSI so it can extract and add the upgrade code.
To learn about upgrade code and how it can help you in your scenario, please follow the Product Identification article from our user guide.

If you have already tested this solution and have encountered any difficulties please let us know so we can further help you.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
IB85lb
Posts: 27
Joined: Tue Oct 12, 2010 10:02 am

Re: creating custom action that uninstall an APP plz help

i already tested it and it not work bec

i dont have the previous msi i had only the product ID
when it upgrading the previous installer didnot remove all the application it replacing it .i check automatically upgrade older product
and the order is uninstall the old version first and install new version.
so what is the problem???
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: creating custom action that uninstall an APP plz help

Hello,

To solve this in your new project, please try adding a "Property Set with Formatted" predefined custom action after the "FindRelatedProducts" standard action.
Set the "Property Name" to:

Code: Select all

OLDPRODUCTS
and the "Formatted Text" value to:

Code: Select all

{[OLDPRODUCTS];{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}
Where {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is your old MSI's Product Code.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
IB85lb
Posts: 27
Joined: Tue Oct 12, 2010 10:02 am

Re: creating custom action that uninstall an APP plz help

Hi

Code: Select all

{[OLDPRODUCTS];{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}
this code what is his job i try it but nothing happen the old product still installed

there is other solution for my problem.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: creating custom action that uninstall an APP plz help

Hello,

OLDPRODUCTS is a Windows Installer property that contains a list with the product codes of the older versions of your installation package. This property is set only in a package which upgrades another package. Since in an upgrade process the product code is evaluated before the upgrade code then the upgrade package will have to uninstall all the packages that have the product code in the OLDPRODUCTS list.
The code simply adds your old package product code to the OLDPRODUCTS list property.

As I said in my previous post please note that {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is your old MSI's product code, where each x is replaced by a alpha-numerical value( something like {26EF8C18-55D3-49EF-9D2D-50E983667DE5} ).
I have tested this solution on my machine and it works fine. Can you please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”