Installation path of an msi - Advanced Installer Community
jammy
Posts: 17
Joined: Mon Sep 08, 2014 7:44 am

Installation path of an msi

Hi Team,

I am using advanced installer Professional 11.6.3 . It has been great so far.

Question : I am updating registry during installation,the registry value i am updating is my application installation path

ex:
[HKEY_CLASSES_ROOT\sip\shell\open\command]
@="\"C:\\Program Files (x86)\\BJN\\BJNLYNC\\RunAppUrlProtocol.exe\" \"%1\""

This path i am hard coding is the default installation path but if user chooses some other directory during installation then i have to update it . How do i update it? and where can i get installation path ?

Thank you,
Jammy
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Installation path of an msi

Hi Jammy,

Thanks for using Advanced Installer.

That's easy, the installation folder location is stored in the APPDIR public property. The user can change it at install time from the FolderDlg and you can predefine it at build time from the Install Parameters page.

You can reference it in the formatted type fields from the Registry page like this:

Code: Select all

[APPDIR]
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jammy
Posts: 17
Joined: Mon Sep 08, 2014 7:44 am

Re: Installation path of an msi

Hi Mihai,

Awesome. it works perfectly fine. but i am having a strange problem, when i pass [APPDIR] to my application as an argument i am unable to get the path after space

ex:
if the path is "C:\Progam Files(x86)\abc\def\" , i am only receiving till "C:\Program" in my application ,Do u have any idea of this behavior ??

It works perfectly fine if there is no space in the path i.e [APPDIR] like "C:\Users\jammy\abc\def\"

Please Help me regarding this issue.

Thanks ,
jammy
jammy
Posts: 17
Joined: Mon Sep 08, 2014 7:44 am

Re: Installation path of an msi

Hi Mihai,

I found the problem if the [APPDIR] is "C:\Program Files(x86)\abc\def\" i.e surrounded by " " then it is send as single argument.
if the path is C:\Program Files(x86)\abc\def\ i.e not surrounded by " " then the path is split into to arguments args[0]=C:\Program and args[1]= Files(x86)\abc\def\




Thanks ,
Jammy

Return to “Common Problems”