PDA

View Full Version : Custom dialog called at the end of install?



trudesea72
07-26-2002, 10:26 AM
Hi all,

I have a custom dialog that needs to read and write to an ini file. A default ini file is provided as standard. The custom dialog reads from this ini file.

The problem is that the ini file is not placed until after the files are installed.

So what would be the best solution?

1. Move the dialog to display after the files are installed
2. Figure out how to place the files on the target machine before the dialog is called

And how would I implement the best solution?

Thanks,
Tim

JoeThompson
07-26-2002, 11:55 AM
Hi Tim,

If I am reading your question correctly you are installing a default ini file that you want to modify based on information typed in a custom dialog during installation.

What I would suggest is to just collect the information from the dialog and then write a deferred custom action to update the ini file. You can run the custom action anytime after the MoveFiles action has been called.

Joe

trudesea72
07-26-2002, 12:48 PM
Thanks for the response Joe, but the dialog reads the values from the ini file and displays the default values. I kind of have to have that ini file present before the dialog is called.

Sorry if I wasn't clear on that.

I keep reading about onfirstuiafter, could I put the custom dialog in that function?

I should mention that I am very new to installshield and know enough about programming to be dangerous and that's about it :)

By the way, this is a standard project.

Thanks,
Tim

JoeThompson
07-26-2002, 12:56 PM
So it seems your real problem is being able to read the ini file before it is installed. I'm pretty sure there is a way to read from the source (like the CD itself) although I don't know how to do it myself.

If your ini file is not that large, you could add properties with the default values to your project and them when you show the dialog and then update the ini file after it is installed via the deferred custom action...

Joe

trudesea72
07-26-2002, 01:17 PM
Well, the only problem with that is the default ini is changed with each release of our product. Someone not familiar with installshield has to be able to edit the defaults. Plus, there are alot of keys and values in the ini file.

Heh, I just spend 2 weeks creating this dialog and the associated code, and now can't put it where I want in the install process :)

I think onfirstuiafter is my best bet at the moment, just need to figure out how to put my dialog in there.

Thanks,
Tim

trudesea72
07-26-2002, 03:11 PM
Ok, got it. Here is what I basically did. Instead of calling the dialog in the onfirstuibefore function like the other dialogs, I just called the function that displays the dialog by exporting the function prototype and setting it to be called oninstalled.

This is under the program feature properties.

Thanks for all the help.
Tim