views:

71

answers:

2

(sorry, not exactly a coding question)

Say I want to install something to the directory C:\pony but the folder 'pony' does not exist, how can I get InstallShield to inform the user that the folder 'pony' does not exist and ask the user if he or she wants to create the directory.

What happens now is the directory is automatically created.

Is this simply a limitation of the install shield I'm using (2008 Express)?

A: 

I don't know of a built-in way to do this. You may need to write some custom code (either InstallScript or MSI custom action, depending on what kind of project you are using) to check whether the directory exists and prompt the user.

CodeSavvyGeek
+1  A: 

Some InstallScript code would do it:

if (ExistsDir(szPath) == NOTEXISTS) then
    if (AskYesNo("The directory does not exist. Would you like Setup to create it?", YES) == NO) then
     abort;
    else
     CreateDir(szPath);
    endif;
endif;
William Leara