Question

Overview

We are currently using installsheild 2012 to create a basic MSI package to deliver our software to clients.

I am a self taught with installsheild so I doubt I will be following best practises I do however possess a reasonable understanding of custom actions, installscript and dialogs. I am a bit unsure on the directory editor and property manager so if these are required then please go slowly.

During the install the user has requested that they be able to install one of our folders to a different drive on their system as it is filled with logging information and has the potential to be quite large. So this folder needs to be installed outside the INSTALLDIR.

Aim

I wish to create a dialog box which would enable the user to choose an install location for this folder during the install.

This process needs to be accomplished through the user interface as it needs to be quite flexible as the contents of the logging folder can change from client to client.

So ideally I would like a folder to be visible in the application data\ files and folders\Destination Computer, section of the interface which would allow whoever comes to maintain the project after me to simply drag and drop the folders in there.

Although the management of the folders will need to be done through the user interface the process behind this i.e. choosing the folder and then copying over the files can be achieved in any way as long as I have a few pointers to help me out

What I have tried

1.Installscript & Custom Action- I wrote a custom action to using the AskPath which would take the location of where the user chose to install the Log folder and then created a directory there. I would hard code the contents of the log folder in installscript (however as the folder structure can change this approach became too hard to maintain)

2.Components & Features – I tried to use the log folder as a separate feature and have its own component but I couldn’t get the property to carry over from the dialog and link the component with the dialog which would choose where to install the log folder.

3.Pre-requisites – I looked online and found that I might be able to install the log folder via the pre-requisites manager by Zipping up the log folder into a self extracting Zip( I haven’t had any luck with this yet and I am hoping that there is a cleaner way)

I think I may have come close in some of my attempts to doing what I wanted but I kept hitting dead ends.

Any help would be greatly appreciated and thank you for reading I know it’s a long post.

Cawston

Was it helpful?

Solution

Just do this:

Create two directories in your installer:

INSTALLDIR = [ProgramFilesFolder]Company\Product LOGDIR = [INSTALLDIR]Logs

Then take a look at the Destination Folder dialog. Clone all of the controls that make the various icons, text and browse button for INSTALLDIR.

Change the display text from [INSTALLDIR] to [LOGDIR]. Next copy the control events on the Browse button and change the [_BrowseProperty] value to LOGDIR instead of INSTALLDIR.

That's it. LOGDIR will start off a child of INSTALLDIR but if the user presses Browse and changes it then that relationship is broken. You can then change INSTALLDIR and it won't change LOGDIR.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top