cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nidheesh_kuvil
Level 4

Get user defined Location using dialog

Hi friends,

Am using installshield 2010 for creating the setup files. I need to copy some files in to a user defined location While installing the setup on a destination mechine.

The destination location is user defined. so i need to get the destination location using one dialog box. (few files needs to be copied in to this location and other files in to installdir)

Can any one help me how to get the user defined location using a dialog

Sample code (or steps) will be a great help

Regards,
Nidheesh
Labels (1)
0 Kudos
(5) Replies
ITI_Randy
Level 6

A little more info maybe...

What type of package are you building? Basic MSI or InstallScript?

Where are the files located that you are copying to the special customer-selected location? Are they included in the package or expected to already exist somewhere on the target machine?
0 Kudos
nidheesh_kuvil
Level 4

ITI_Randy wrote:
A little more info maybe...

What type of package are you building? Basic MSI or InstallScript?

Where are the files located that you are copying to the special customer-selected location? Are they included in the package or expected to already exist somewhere on the target machine?


Hi,
Using a Basic MSI. But with using few installscript. Am including the files in package.

so whenever a user selects the folder name i can use settarget method(forgot the method name) to set that folder. Am able to wok with hardcoded folder name, but i dont know how to get it using dialog


regards,
nidheesh
0 Kudos
ITI_Randy
Level 6

Start in the User Interface > Dialogs section of your InstallShield IDE. There you will find existing dialogs which demonstrate what you are describing. For instance, look at the “DatabaseFolder” dialog and how it works. Expand the “DatabaseFolder” node in the Dialogs view. In the “Behavior” you will notice that when clicking the “ChangeFolder” PushButton, a “SpawnDialog” event is defined to spawn the “InstallChangeFolder”. When the “ChangeFolderDialog” is shown, the user can browse to a folder location which gets saved to a property called “_BrowseProperty”. Back in the “DatabaseFolder” dialog events, you will notice that this value is then assigned to a “DATABASEDIR” which is a folder defined in the Directory table of the Direct Editor.

The same scenario described above is done with the “DestinationFolder” dialog, also shown in the dialogs view. In this dialog, the value of the browse after bringing up the “ChangeFolderDialog” is assigned to INSTALLDIR.

A quick and simple solution would be to use one of the dialogs mentioned above in your dialog sequence. Change the wording on the folder as desired and reassign the folder browse value in the dialog from “DATABASEDIR” or “INSTALLDIR” to your own folder definition added to the Directory table in Direct Editor. Once this is done, you only need to set the Destination of your components to your folder property. ([MyFolder]…).
0 Kudos
nidheesh_kuvil
Level 4

ITI_Randy wrote:
Start in the User Interface > Dialogs section of your InstallShield IDE. There you will find existing dialogs which demonstrate what you are describing. For instance, look at the “DatabaseFolder” dialog and how it works. Expand the “DatabaseFolder” node in the Dialogs view. In the “Behavior” you will notice that when clicking the “ChangeFolder” PushButton, a “SpawnDialog” event is defined to spawn the “InstallChangeFolder”. When the “ChangeFolderDialog” is shown, the user can browse to a folder location which gets saved to a property called “_BrowseProperty”. Back in the “DatabaseFolder” dialog events, you will notice that this value is then assigned to a “DATABASEDIR” which is a folder defined in the Directory table of the Direct Editor.

The same scenario described above is done with the “DestinationFolder” dialog, also shown in the dialogs view. In this dialog, the value of the browse after bringing up the “ChangeFolderDialog” is assigned to INSTALLDIR.

A quick and simple solution would be to use one of the dialogs mentioned above in your dialog sequence. Change the wording on the folder as desired and reassign the folder browse value in the dialog from “DATABASEDIR” or “INSTALLDIR” to your own folder definition added to the Directory table in Direct Editor. Once this is done, you only need to set the Destination of your components to your folder property. ([MyFolder]…).



hi,

thank you very much for your valuable reply. i tried the given suggestion, and worked for me once. After that i created a new msi and tried the same scenario and it is not working.

Also i need to default one path in the edit area. can you please suggest me where am doing wrong

Regards,
Nidheesh
0 Kudos
ITI_Randy
Level 6

There must be something a little off in the newer one you created that isn’t working. Compare with the one that did work and see if you can locate the difference. Check to verify that you have a directory defined in the Directory table of Direct Editor.

For the default value, follow again the example on the existing dialog for “DestinationFolder” in your folder dialogs. In the Dialogs view, expand the “DestinationFolder” dialog and click on the graphical view (the “English-United States” node in mine) . You will see a text label there called “Location”. Notice that this label is set to a property value of “_BrowseProperty” and has a Text value of [INSTALLDIR] (pulling the value of the INSTALLDIR). Again, you will want to do something similar. Here, [INSTALLDIR] will be replaced with your directory you have defined in the Direct Editor Directory table. The value of your directory which is defaulted is whatever your folder resolves to based on its definition in the directory table.

Be careful that your directory parent is a valid location on the target machine. Do not set the text of the dialog to a hard-coded value, such as “C:\MyFolder”, as this will blow up with errors if this location is not available on the target machine. Instead, set the directory definition to have a valid parent which is properly resolved in the Directory table.
0 Kudos