Get "Default User" 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!

mgorga
Posts: 45
Joined: Fri Jun 03, 2011 1:00 pm

Get "Default User" path

Dears,
we need to create a new folder on that path: "C:\Documents and Settings\Default User\Application Data". This path is localized so we can not use a constant. We look for this path on that link of folder paths, without success: http://www.advancedinstaller.com/user-g ... paths.html

The property AppDataFolder creates a folder on the "current user" folder. Our requirements is to create always on the "default user" folder. How can we get this path? We need the installer for Windows Server 2003 and must work independent of the system's language.

Best regards,
Mario
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Get "Default User" path

Hi Mario,

Unfortunately there is no Windows Installer property that points to that path, but you can create your own.

First you can go in the Search page and create two registry searches for the registry mentioned in the How to Set the Path for the Local Default User Profile article.

Then you can go in the Install Parameters page and create a new property (i.e. MY_PATH), go in the Custom Actions page and create a "Set installer property" custom action which sets the property you created with the combined values of the properties resulted from your searches. For example:
  • Property: MY_PATH
    Formatted: [RESULT_PROPERTY_1]\[RESULT_PROPERTY_2]
A similar method and a description of how to create a property-based folder can be found in the How do I install files in a custom folder tutorial.

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
mgorga
Posts: 45
Joined: Fri Jun 03, 2011 1:00 pm

Re: Get "Default User" path

Thanks for your answer,
I finally used a different approach. I created a custom action (Execute script inline code) with a vbscript that return’s me the Application Data path from the all users account “C:\Documents and Settings\All Users\Application Data” and replaced “All Users” with “Default User”. Then, this value is assigned to a property. I tried on windows 2003 in Spanish, and the Default User account has the same name, so I assume it should work independently of the OS language.

This is the vbscript:
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H23&)
Session.Property("DEFUSRAPPDATA") = Replace(objFolder.Self.Path,"All Users","Default User")

Best regards,
Mario

Return to “Common Problems”