This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- EnterDisk Question
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2007
11:25 AM
EnterDisk Question
I'm attempting to prompt a user for a SQL Server 2005 CD by using EnterDisk during OnMoved().
Some problems I can forsee is, if the customer already owns SQL Server 2005, then any key file I can provide wont exist. I would assume that I could just use a common file that exists on all SQL Server 2005 CDs for the key file, but maybe that's not 100% guaranteed.
The problem I'm assuming I will run into is that once they pass the EnterDisk prompt by providing a media that is valid, how can I call LaunchAppAndWait on the SQL Server 2005 installation if I don't know the source? EnterDisk does not return a value for the path that was browsed to. It could possibly be on a local drive and not a CD ROM.
In a perfect world we provide them with the CDs, the key file is always there, and I launch it from where I know it will be.
Any suggestions are welcome.
Some problems I can forsee is, if the customer already owns SQL Server 2005, then any key file I can provide wont exist. I would assume that I could just use a common file that exists on all SQL Server 2005 CDs for the key file, but maybe that's not 100% guaranteed.
The problem I'm assuming I will run into is that once they pass the EnterDisk prompt by providing a media that is valid, how can I call LaunchAppAndWait on the SQL Server 2005 installation if I don't know the source? EnterDisk does not return a value for the path that was browsed to. It could possibly be on a local drive and not a CD ROM.
In a perfect world we provide them with the CDs, the key file is always there, and I launch it from where I know it will be.
Any suggestions are welcome.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2007
03:46 PM
I assume you are doing an InstallScript project.
I haven't worked with an InstallScript project in a while, but why don't you look at the Sd dialog functions and use one that asks for a path, and have the user browse to the location of the SQL setup program? Then you would pass the path that is returned to LaunchAppAndWait() to run the SQL setup program.
Would that work for what you want to do?
I haven't worked with an InstallScript project in a while, but why don't you look at the Sd dialog functions and use one that asks for a path, and have the user browse to the location of the SQL setup program? Then you would pass the path that is returned to LaunchAppAndWait() to run the SQL setup program.
Would that work for what you want to do?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2007
03:59 PM
It would gridman. I guess the only problem is that I'm displaying this dialog well past the interview process (OnMoved), so the next/back button can't exist. Just OK or Cancel I suppose. The structure of the EnterDisk dialog is perfect if it just returned a string variable to me.
Maybe I can clone the dialog and edit out the buttons.
Maybe I can clone the dialog and edit out the buttons.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2007
05:19 PM
Is there a reason you are going to ask for the path to the SQL Server setup program in OnMoved? You could do it at the end of OnFirstUIAfter(), after everything in your installation program has been done. Just display the dialog to get the path from the user, then call LaunchAppAndWait with the NOWAIT option, and the SQL program would then start and your setup program would end.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2007
05:37 PM
You could try to use the SdAskDestPath() function. Before that, call the Disable() function with the BACKBUTTON parameter to disable the Back button, so they can't go back. Something like this:
Disable(BACKBUTTON);
SdAskDestPath(szTitle,szMsg,szPath,0);
LaunchAppAndWait(szPath,szCmdLine,LAAW_OPTION_NOWAIT);
Disable(BACKBUTTON);
SdAskDestPath(szTitle,szMsg,szPath,0);
LaunchAppAndWait(szPath,szCmdLine,LAAW_OPTION_NOWAIT);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 21, 2007
10:13 AM
Thanks for the help grid.
I decided to just clone EnterDisk and used this custom function to return the value. If anyone needs to do something similar and finds this in a search:
Now just call SdPromptForCD(szSQLDirectory); and the szSQLDirectory variable can be passed to whatever; in my case, a batch file write.
I decided to just clone EnterDisk and used this custom function to return the value. If anyone needs to do something similar and finds this in a search:
// Dialog and control IDs.
#define RES_SQL_DIALOG_ID 13399 // ID of dialog itself
#define RES_PBUT_OK 1 // ID of OK button
#define RES_PBUT_CANCEL 9 // ID of Cancel button
#define RES_PBUT_TEXT 4 //Text box
#define RES_PBUT_BROWSE 31 //Browse button
prototype SdPromptForCD(BYREF STRING);
function SdPromptForCD(szSQLDirectory)
STRING szDialogName, szEditBoxStatusText, szTreeControlStatusText, svDir;
NUMBER nDialog, nResult, nCmdValue, nId;
BOOL bDone;
HWND hInstance, hwndParent;
begin
// Specify a name to identify the custom dialog in this installation.
szDialogName = "SQL_CD_PROMPT";
nResult = EzDefineDialog (szDialogName, "", "", RES_SQL_DIALOG_ID);
if (nResult < 0) then
// Report an error; then terminate.
MessageBox ("Error in defining dialog", SEVERE);
abort;
endif;
// Initialize the indicator used to control the while loop.
bDone = FALSE;
// Loop until done.
repeat
// Display the dialog and return the next dialog event.
nCmdValue = WaitOnDialog(szDialogName);
// Respond to the event.
switch (nCmdValue)
case RES_PBUT_TEXT:
CtrlGetText( szDialogName, RES_PBUT_TEXT, szSQLDirectory );
case RES_PBUT_BROWSE:
svDir = SRCDIR;
SelectDirEx ( "", "", szEditBoxStatusText, szTreeControlStatusText, BIF_RETURNONLYFSDIRS, svDir );
CtrlSetText (szDialogName, RES_PBUT_TEXT, svDir);
case DLG_CLOSE:
// The user clicked the window's Close button.
Do (EXIT);
case DLG_ERR:
MessageBox ("Unable to display dialog. Setup canceled.", SEVERE);
abort;
case DLG_INIT: ;
CtrlSetText (szDialogName, RES_PBUT_TEXT, SRCDIR);
case RES_PBUT_CANCEL:
// The user clicked the Cancel button.
Do (EXIT);
case RES_PBUT_OK:
nId = NEXT;
bDone = TRUE;
endswitch;
until bDone;
// Close the dialog.
EndDialog (szDialogName);
// Free the dialog from memory.
ReleaseDialog (szDialogName);
return nId;
end;
Now just call SdPromptForCD(szSQLDirectory); and the szSQLDirectory variable can be passed to whatever; in my case, a batch file write.