Installing files in the user folder - 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!

mmcbride
Posts: 5
Joined: Wed Apr 21, 2010 10:55 am

Installing files in the user folder

Is there a way to install files into the user folder of the target machine?

I see the Files and Folders section gives access to My Documents etc, so presumably it is possible?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Installing files in the user folder

Hi,

Where in the user folder do you want to install? Most products use a subfolder in AppData folder ("Application Data" in Files and Folders page).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AnneTheAgile
Posts: 61
Joined: Wed Jun 08, 2011 9:53 pm

Re: Installing files in the user folder

I'm working on perhaps a similar issue. My goal is to have a set of files that represent choices and then paste the appropriate choice's copy into the proper folder.

For example:
destination = c/programFiles/myorg/myapp/customizedFolder/file.txt (this is the base case file)
input possibilities = from my local drive, /Question1FileOptions/ has file1.txt, file2.txt.
Once the questionnaire is done, if choice 2 is made, I should have ;
destination = c/programFiles/myorg/myapp/customizedFolder/file2.txt.
mmcbride
Posts: 5
Joined: Wed Apr 21, 2010 10:55 am

Re: Installing files in the user folder

I just mean the standard Windows user folder, ie c:\Users\[Username]. Obviously I don't know what the end users username will be, so it has to be done at install time.

I could use AppData. I am using Java, which has a standard way of finding the User folder, which AFAIK works for Linux too. If I use AppData, I will need different code for the Linux version which is a bit of a pain.

AppData is actually in the User folder.

Looking on my own PC, which has quite a few applications installed, I think some applications use AppData, some use the User folder.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Installing files in the user folder

AnneTheAgile wrote:I'm working on perhaps a similar issue. My goal is to have a set of files that represent choices and then paste the appropriate choice's copy into the proper folder.
I'm not sure I understand what you need to do. Can you please give me more details? You can create a separate thread if you want.
I just mean the standard Windows user folder, ie c:\Users\[Username]
This is rarely used by applications, especially on Vista and Windows 7. This is why Windows Installer doesn't have a predefined folder for it. But if you really want to use it, you can try this approach:
- create a custom public property in Install Parameters page
- use that property for a property-based folder in Files and Folders page and add your files in it
- write a DLL or VBScript custom action which retrieves the path you want and sets it in the custom property
- add it before InstallUISequence -> CostFinalize standard action

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mmcbride
Posts: 5
Joined: Wed Apr 21, 2010 10:55 am

Re: Installing files in the user folder

Do you have an example VBScript for doing this?

I'm quite surprised that you think it is rare to put things in the User folder. If I look in the User folder on my own PC, there are dozens of folders in there created by different applications including mainstream applications NetBeans, Google AppInventor and Gimp. It makes things easier for cross platform products.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installing files in the user folder

Hi,
Do you have an example VBScript for doing this?
I'm afraid not, but we have an example in our user-guide which shows you can implement this without writing any code, just using our built-in support.
I'm quite surprised that you think it is rare to put things in the User folder....
Microsoft recommends AppData as the location for all data stored per-user, as you can see in the following list of predefined folders. We present in the Files and Folders page only the predefined folders supported by Windows Installer. For creating custom folders you have the option of using a property based folder, as presented in the above article from our user-guide.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”