User Install Directory 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!

varungoel
Posts: 3
Joined: Mon Mar 23, 2009 3:47 pm

User Install Directory Path

Hi,

I am building an installer where I have to delete some extra files during uninstall from the User Directory but I am not getting the Path where the user has installed the product other than default location.

I have used custom code action

Dim StrFolderPath
StrFolderPath = Session.TargetPath("APPDIR")

but the above code gives me the default path
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: User Install Directory Path

Hi,

Please note that the APPDIR property uses the default value during an uninstall. If you need the installation path during an uninstall process you can try one of these approaches:
1) In the Registry page create a new value which contains the APPDIR property. During an uninstall you can use a search to retrieve it from the registry.

2) Use a search to get the installation path from this registry entry:

Code: Select all

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\<ProductCode>\InstallLocation
where you replace "<ProductCode>" with the Product Code of the package. Please note that if the package is installed per-user, you can search in the HKEY_CURRENT_USER hive.

The property of the search will contain the value of the registry entry.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
varungoel
Posts: 3
Joined: Mon Mar 23, 2009 3:47 pm

Re: User Install Directory Path

Hi Cosmin
Thanks for feedback

Just want to know is there any other variable of AI like "APPDIR" which gives us the Absolute Path of the user machine where he/she had installed the product.

Actually, what I had done before getting your feed back .I had written a custom code action in vb script where I was creating a text file and writing the path of "APPDIR" in it and the same text file would be reading during uninstall time for the user Install Directory Path.



Regards
varun
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: User Install Directory Path

Hi,

I'm afraid that the installation folder is not available during the uninstall process by default (there isn't any property for this). However, it can be retrieved from the registry like I explained or from a file like you are doing in your project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”