Harish
Posts: 35
Joined: Tue Dec 27, 2005 9:25 am

Second prompt for installation of some folder

Hi,

While Insatlling the package it will ask for the Target Directory. In our application we have two things to be done. One folder to be insatlled at one loaction assume C:\Inetpub\wwwroot\(Its a Traget Directory) and some other directory in d:\ or C:\ depinding upon user choice. How it can be achieved.

Thanks,
Harish.Y
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

In order for the user to select the second folder you may use a Script Inline Custom
Action that displays an InputBox and sets a property (let's name it SECONDFOLDER).
You also need to define a new Property Based folder in the "Files and Folders" page.

The required steps are given below:

1. In the "Install Parameters" page, define a new property named SECONDFOLDER and set
its value to "C:\" (without quotes) for example.

2. In the "Files and Folders" page select from the toolbar "New Folder -> Property
Based" then select the SECONDFOLDER property. Add all the files and folders you want
installed to the second folder to this directory.

3. Switch to the Custom Actions page, right click the IntallUISequence item
and select "Show Standard Action -> UI Starting".

4. Right click the "UI Starting" item and select "New Custom Action -> Script Inline".

5. In the Script Text field enter something like:

Code: Select all

Session.Property("SECONDFOLDER") = InputBox("Prompt string", "Title string", Session.Property("SECONDFOLDER"))
[important edit 30-03-2006]

The Directory paths are resolved during CostFinalize as follows:
- if a Property with the same name as the key of a Directory table entry exists, the value of that Property will be used to resolve the folder path
- otherwise, the folder path is resolved using the directory parent path

When the directories are resolved during the CostFinalize action, the keys in the Directory table become Properties set to directory paths.

Therefore, if a Property Based Folder contains subfolders, the Property must be changed before CostFinalize (otherwise, the subfolders will end up in the default location).

The UI Starting Action comes after CostFinalize, therefore you need to use the following script code instead of the one above (such that the subfolder paths are resolved in addition to the parent folder path):

Code: Select all

Session.TargetPath("SECONDFOLDER") = InputBox("Prompt string", "Title string", Session.Property("SECONDFOLDER"))
This problem appears very seldom when the following conditions are met:
- the Property Based Folder contains subfolders whose names contain only upper-case letters
- those folders are added in AI using the "Add Folder" toolbar button (or context-menu item). When the package is built, their ID in the Directory table will contain only upper-case letters, therefore their associated Properties during the CostFinalize Action of the UI Sequence will be Public Properties (these are passed from the UI Sequence to the Execute Sequence and thus the folder paths will not be resolved again on the CostFinalize Action of the Execute Sequence).

However, if the folder IDs in the Directory table do not contain only upper-case letters, their associated Properties during the CostFinalize Action from the UI Sequence will be Private Properties (these are not passed to the Execute Sequence and therefore the folder paths will be resolved again on the CostFinalize Action of the Execute Sequence).

[end edit 30-03-2006]


6. Set the Execution Condition for this Custom Action to (Not Installed).

Regards,
Denis
Last edited by Ionut on Thu Mar 30, 2006 4:40 pm, edited 4 times in total.
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Harish
Posts: 35
Joined: Tue Dec 27, 2005 9:25 am

Thanks Dennis that solved my problem it really worked. But i want the dialog box of same size which looks same as Advanced Insatller Dialog box.

Thanks,
Harish.Y
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Advanced Installer does not currently support full UI customization, but this feature is on top of our TO DO list.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”