How to obtain old product path - 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!

Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

How to obtain old product path

Hi,

If I make a new package for upgrade previous version and during install user changes installation folder, am I possible to obtain old installation folder? And if yes, how can I do it?

Thanks

D.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to obtain old product path

Hi,

The old installation path is automatically detected by the new package and set in APPDIR during the standard action "MigrateFeatureStates". Using a search you can
obtain it in a new property so you can access it at anytime even if the user has changed the installation path in the new package.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

Re: How to obtain old product path

I've tried to show APPDIR property during MigrateFeatureStates action, but it already contains new installation folder. I tried to show the folder with message box, where action data is set to
[APPDIR] | Default title | MB_OK , MB_ICONINFORMATION | BTN_PRESSED | [CLIENTPROCESSID]

What is wrong? Or I have to read another property?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to obtain old product path

Hi,

Sorry David, it seems I've made a little confusion. "MigrateFeatureStates" standard action will set only the state of the features not and the old installation path.

I'm afraid the only solution is to retrieve the path from the registry (if you have saved it there when installing the old version) using a registry search, in the Search page.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

Re: How to obtain old product path

So, after running package I can choose where will be application installed (form "Select Installation folder"), for example "C:\Program Files\Your Company\Serial Number Validation Sample\"
After this I install new version (with new product code). I get the same form "Select Installation folder" and I choose another folder, for example "C:\Program Files\Alien Company\Serial Number Validation Sample\". But during upgrade I need to know previous folder ( "C:\Program Files\Your Company\Serial Number Validation Sample\"). But I don't know way how to obtain that. Reason is I need use that in custom action.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to obtain old product path

Hi,

As I said in my above post (edited) the only solution is to save the path in the registry and retrieve it from there using a search.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Davidoff
Posts: 6
Joined: Tue Jun 08, 2010 9:11 am

Re: How to obtain old product path

I see, but old version don't save path to registry. So, do you mean that doesn't exist another way?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to obtain old product path

Hi,

If you haven't save this entry anywhere in the computer you can try to search for the main EXE of your application, and if found you can parse that path (using a custom action) to obtain the installation path
set for that version.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sony
Posts: 134
Joined: Wed Apr 07, 2010 9:55 am

Re: How to obtain old product path

Hi Support,

Can you please explain this suggestion:

"If you haven't save this entry anywhere in the computer you can try to search for the main EXE of your application, and if found you can parse that path (using a custom action) to obtain the installation path
set for that version."

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

Re: How to obtain old product path

Hi Sony,

My colleague means that if your old product hasn't saved its installation path anywhere in the registry, you can add a search in the Search page for the .EXE of that product. If that .EXE is found, you can parse the return location to get the folder path location only.

Here is a similar thread you may find useful.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sony
Posts: 134
Joined: Wed Apr 07, 2010 9:55 am

Re: How to obtain old product path

Hi Mihai,

Thank you for your suggestions.

I am able to get the from the suggestions provided by your colleague in the mentioned thread.

But the copying of the folders is not happening during the patch installation. In the modified package, i am getting path of the previous installed path by using search option.

Under MigrateFeatureStates, I have added a message box to display the found path and next to that I am using xcopy to copy the folder . Here is the custom action

source path:C:\WINDOWS\system32\xcopy.exe
source type:Executable(*.exe)
Command line:[RESULT_PROPERTY] "D:\Test\" /s /e /y /q /I
Expression: PATCH

But the copying of the folders is not happening.. am I doing anything wrong in configuring the custom action?

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

Re: How to obtain old product path

Hi Sony,

Please make sure you follow the steps described in the following article. Also, please try running the "xcopy.exe" command outside the installer and see if it works.

Is the message box custom action executing when running the patch?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sony
Posts: 134
Joined: Wed Apr 07, 2010 9:55 am

Re: How to obtain old product path

Hi Mihai,

The message box custom action executing while running the patch. xcopy is working fine from the normal installer.But it not working while running the patch. I have also set "PATCH"condition for xcopy custom action.

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

Re: How to obtain old product path

Hi Sony,

You can try to schedule the custom action after the Install standard action.

Also, instead of attached custom custom action you can try a Launch File or Open URL predefined custom action with the command line field beginning with:

Code: Select all

xcopy.exe
followed by the required arguments. Here is technet article to help you out.
Also you should set it with the "Deferred, with no impersonation" execution option.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sony
Posts: 134
Joined: Wed Apr 07, 2010 9:55 am

Re: How to obtain old product path

Hi Mihai,

I have implemented ur suggestion.But its not working during the patch installation.

I have used the "Launch a file or URL" under Install standard custom action, under commandline property, i specified the arguements:

xcopy.exe "[RESULT_PROPERTY]" "D:\Test\" /s /e /y /q /I
Expression: PATCH

Its not getting copied to specified location.

Regards
sony

Return to “Common Problems”