by 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