Greg102
Posts: 6
Joined: Tue Sep 02, 2008 10:26 am

install folder on parent appdir+Folder2

1. appdir = C:\Program files\ Company\ Produkt1
2. Folder2 I want install to C:\Program files\ Company\ Produkt2
3. appdir choose user

I tried:
Folder Property Based
Property - Install Parameters PathProdukt2=c:\
I Change this property after user change appdir via vbs (Session.Property=C:\Program files\ Company\ Produkt2)
MsgBox Session.Property(PathProdukt2)
I see C:\Program files\ Company\ Produkt2
Why my files are installed in c:\ ?!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: install folder on parent appdir+Folder2

Hi,

Please note that the User Guide contains the Install files in a custom folder how-to which may help you. Basically, you create a property-based folder and set its property to something like this:

Code: Select all

[ProgramFilesFolder][Manufacturer]\Product2
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Greg102
Posts: 6
Joined: Tue Sep 02, 2008 10:26 am

Re: install folder on parent appdir+Folder2

I can not use [ProgramFilesFolder], because in my case destination path choose user.
I have property-based folder, but after user choose destination I want change property on value which I build based on on user destination path
Default is [ProgramFilesFolder][Manufacturer]\Product2
When user change destination on c:\Product1, I want change property on c:\Produkt2 (parent: c:\ + Produkt2), but it still install do [ProgramFilesFolder][Manufacturer]\Product2
Why?!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: install folder on parent appdir+Folder2

Hi,

If you need to use the modified install location you can try using a custom action. Basically, the custom action should do this:
- retrieve the value of the APPDIR property (the installation path)
- eliminate the last folder name in the path
- add the custom folder name in the path
- save the new path into the custom property used by the property-based folder

Here is some sample VBScript code:

Code: Select all

Dim origPath
Dim customPath
Dim tokens

' get the install path
origPath = Session.Property("APPDIR")
tokens = Split(origPath, "\")

' initialize the path lenght and the custom path
Dim index
Dim parentLenght
parentLength = UBound(tokens) - 2
customPath = ""

' obtain the main install path
For index = 0 To parentLength
    If Not(tokens(index)) = Empty Then
		customPath = customPath & tokens(index) & "\"
	End If
Next

' add the custom folder
customPath = customPath & "Product2"

' set the property with the custom path
Session.Property("CUSTOM_PATH") = customPath
This code can be pasted into a .VBS file which can be added as an Attached custom action under "InstallExecuteSequence" -> "Begin". It will set the "CUSTOM_PATH" property to the original installation path, but with "Product2" instead of "Product1".

Another approach would be to use a custom dialog which allows the user to browse for the two folders.

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

Return to “Common Problems”