Solved

InstallShield Pro NEWBIE: How to implement AskPath?

Posted on 2006-06-19
1
439 Views
Last Modified: 2010-07-27
Dear Experts,

I work for a small company, and I'm afraid I'm in way over my head on this one thing:  I need to modify our InstallShield Pro (11.5) setup to allow the user to select the target pack and directory.  So far, we have done only the simplest things with InstallShield (mostly in Express), and I know next to nothing about the more advanced features.

I have found this AskPath example (below) in their Help, but I have no idea how to implement it. (Where do I PUT it?)  I don't know what an "entry-point function" is, or how to "execute the custom action in a sequence".  Could anyone either tell me some step-by-step instructions, or maybe point me to a user-friendly site for beginners?  

Thanks a lot!
--BrianMc1958


NOTE
To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.
/*-----------------------------------------------------------*\
 * InstallShield Example Script
 * Demonstrates the AskPath function.
 * This script obtains the path to a folder on the
 * end user's computer.  If the path does not exist, it creates
 * a folder at that location if indicated by the
 * end user.  Finally, it displays the selected path.
 *
\*-----------------------------------------------------------*/
// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"
      export prototype ExFn_AskPath(HWND);
function ExFn_AskPath(hMSI)
    STRING szMsg, svResultPath[101];
    BOOL bTargetDirOk;
begin
    // Disable the Back button in installation dialog boxes.
    Disable (BACKBUTTON);
    // Create the message to display in the AskPath dialog box.
    szMsg = "Specify a folder for the application.";
    // Initialize valid path indicator.
    bTargetDirOk = FALSE;
    repeat
        // Get a path from the user.  The default path is
        // the current value of the system variable INSTALLDIR.
        if (AskPath (szMsg, INSTALLDIR, svResultPath) = NEXT) then
            // Does the path entered by the user exist on the
            // target system?
            if (ExistsDir (svResultPath) = 0) then
                // If it exists, set indicator to exit the loop.
                bTargetDirOk = TRUE;
            else
                // If the path doesn't exists, ask if it should be created.
                 if (AskYesNo ("Folder does not exist. Create it?",YES) = YES) then
                    // Attempt to create the folder (directory).
                    if (CreateDir (svResultPath) =0) then
                        // If the folder was created, set indicator to exit the loop.
                        bTargetDirOk = TRUE;
                    else
                        // Inform the end user that the folder was not created.
                        MessageBox ("Unable to create " "+ svResultPath, WARNING);
                    endif;
                endif;
            endif;
        endif;
    until bTargetDirOk;
    // Display the name of the target folder.
    MessageBox ("The target folder is " + svResultPath, INFORMATION);
    // You'd also enable the Back button for subsequent dialog boxes.
    Enable (BACKBUTTON);
end;

0
Comment
Question by:BrianMc1958
1 Comment
 
LVL 30

Accepted Solution

by:
ded9 earned 500 total points
ID: 16935642
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the best software (free and paid) to convert NEF to JPG? 5 70
I need a software suggestion 4 71
Scripting vs. Programming languages 25 151
Java JRE greater than 1.6 5 50
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now