Install files in User Home directory

Having trouble running Advanced Installer? Got a bug to report? Post it all here.

Install files in User Home directory

Postby Guest » Thu Jun 02, 2005 6:28 pm

Is it possible to install files into the userhome directory without using custom actions?
E.g. c:\documents and settings\USER\

I know there is Application Data etc. but I cannot find any directory corresponding to the userhome dir.

Thanks!
Guest
 

Postby Mike » Fri Jun 03, 2005 5:30 pm

Hi,

To install the files in the userhome folder you need to change in the "Install Parameters" tab the "Application folder" text field to the string "[WindowsVolume]Documents and Settings\[LogonUser]".
To generate this string do the following:
- First empty the text field.
- Click the <Edit> button beside the text field. Click the <Folder> button and select the "Windows Volume" branch. Click OK. DON'T close the "Edit Application Folder" dialog.
- type "Documents and Settings\" after the value that has appeared.
- click the "Property" button. Select the "User Information"->"Logon User" branch. Click OK.

The danger is that this works only for the versions of Windows that store the user informations in the "Documents and Settings" folder.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Mike
 
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania

Postby Alexander » Mon Jun 06, 2005 2:53 pm

Hi,

also "Document and Settings" is called "Dokumente und Einstellungen" on an German Windows, so it wouldn't work there ...
kind regards,
Alex
Alexander
 
Posts: 29
Joined: Thu Dec 30, 2004 12:47 pm
Location: Germany

Postby Mike » Tue Jun 07, 2005 10:38 am

Hi,

You can use a simple custom action.

In order to install your application in the "UserHome" folder you have
to take the following steps:

1) In the "Install Parameters" tab create a new property, say "userHome".

2) In the "Files and Folders" tab right click "Target Computer" and select "New Folder"->"Property Based". In window that appears select the "userHome" property and click <OK>.

3) Add in this new folder the files that you want to be installed in the userhome directory.

4) Create a new custom action. On the "Custom Action" tab right click on
"Target Computer" and select "Show Standard Action"->"Before Initialization"->"Begin". A new section named "Begin" appears in the
tree. Right click this branch and select "New Custom Action"->"Script
Inline".

5) In the "Custom Action Properties" window select as "Source Type" "Visual Basic Script" and in the "Script Text" field write:

Session.property("userHome")=Left(Session.property("AppDataFolder"),InStrRev(Session.property("AppDataFolder"),"\",Len(Session.property("AppDataFolder"))-1))

Note: this goes on the same row.

6) In the "Dialogs" tab right click "Select Location" branch and select
"Delete", to remove the "Select Location" dialog, since the custom
action will overwrite any chosen path.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Mike
 
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania


Return to Common Problems

Who is online

Users browsing this forum: Google [Bot] and 3 guests