cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pizzaman
Level 3

User Choose Whether or Not to Run Utility

Hi,

I have this DB utility which i want to be part of my install. It's just an exe. I want the user during install to be prompt with a dialog of radio button to whether or not run this utility. I am using a Basic MSI project. I have a custom dialog made. I have searched all the forums, I am not sure where to start!

:confused:
Labels (1)
0 Kudos
(11) Replies
Christopher_Pai
Level 16

Drag a RadioButtonGroup control onto the dialog and associate it to a public property ( a property is considered public if it's all Caps like RUNMYAPP ). Add that property name to the SecureCustomProperties property ( see help for more info ).

Add a series of RadioButtons to the RadioButtonGroup. Associate each button to a value such as TRUE or FALSE. This is the value assigned to RUNMYAPP.

Set a condition on your custom action like: RUNMYAPP="TRUE"

Also remember that if your CA changes the system state it should be scheduled as deferred and also have an rollback CA.
0 Kudos
RobertDickau
Flexera Alumni

(To ask a single yes-no question, a check box control might be more appropriate, about which see the "Using Check Boxes in Windows Installer" tip on the Tips & Tricks page: http://www.acresso.com/products/installation/installshield.htm?tabContent=/products/installation/installshield/res_4744.htm... The "Launching Your Application after Installation" tip there might help, too.)
0 Kudos
Pizzaman
Level 3

Ok, so i am able to have a conditional run on the DB app. But i just realized that the exe requires some sql files to be present. It looks for it. How do I include those files so my custom exe will find them? Because when I run the install i am getting a

""A program run as part of the setup did not finish as expected..."
0 Kudos
Christopher_Pai
Level 16

Are you sure you need an EXE custom action? InstallShield can process SQL scripts for MySQL, MSSQL and Oracle.

Now if you are sure you need an EXE, keep in mind that MSI doesn't support making additional files available to a custom action. However, InstallShield has Support Files and InstallScript has a LaunchAppAndWait() function. Combining these two features would do what you (think you) want.
0 Kudos
Pizzaman
Level 3

Hmm, the utility basically checks to see if the database is already there, if so, checks the the version then updates it with extra tables.

The .exe file requires the sql files to be in the same folder. I added those sql files in the Support Files section in MSI Project. However it cannot find those files during execution. So it seems like there might not be a way to have dependant files as part of the setup file?
0 Kudos
Christopher_Pai
Level 16

What database engine? With the right error handling in your SQL statements, a simple SQL script could probably be created to get rid of the exe.

Otherwise, put the EXE in the Support Files also and call it from an InstallScript custom action. Use MsiGetProperty to get the SUPPORTDIR property to know where to call the exe from. The SQL files will be in the same directory.
0 Kudos
Pizzaman
Level 3

Hi,

Ok so I added the exe and supporting files into the support files section. I started a script using SUPPORTDIR^"app.exe".

I used LaunchApp to launch it. But it is not firing and returning a -1.

When i did an output for the SUPPORTDIR it pointed to some temp directory inthe local settings folder. By looking at it, non of the files I added to the support dir exists there. Am I missing something? When does it copy those files into temp?

Thanks for the quick responses!!
0 Kudos
DLee65
Level 13

The issue is probably a sequence issue. If you execute after InstallFinalize then I believe your Support Files are gone. In this case you are better off either installing the file to INSTALLDIR and retrieving the file from there, OR putting the file on Disk1 and retrieving it from there. Some of this depends on your method of delivery as well.

Can you sequence this before InstallFinalize?
0 Kudos
Pizzaman
Level 3

This is executed in a dialog box within the InstallWelcome sequence.
0 Kudos
DLee65
Level 13

Hmmm, then support files should be extracted. Do you have a log file? What does that say about extracting files? Does it list your file that you need?
0 Kudos
Christopher_Pai
Level 16

SUPPORTDIR^"app.exe" isn't valid. You have to call:

nvSize = 255;
MsiGetProperty( hMSI, "SUPPORTDIR", svSupportDir, nvSize );
svSupportDir ^ "app.exe";


Run it through the debugger and you'll see SUPPORTDIR and [SUPPORTDIR] resolve to two different locations.
0 Kudos