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
- :
- Re: Need help in creating option based installer
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
‎Jul 05, 2011
01:20 AM
Need help in creating option based installer
Hi,
I am trying to do the option based installer.
I have three exe's e.g.one.exe,two.exe,three.exe.
What I want to do is like,at the begining of installation installer should give three options to user asking which exe you want to install.That means it should give three options.So what should be my approach.
Please provide me your guidance on this.
Thanks in advance.
I am trying to do the option based installer.
I have three exe's e.g.one.exe,two.exe,three.exe.
What I want to do is like,at the begining of installation installer should give three options to user asking which exe you want to install.That means it should give three options.So what should be my approach.
Please provide me your guidance on this.
Thanks in advance.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 05, 2011
04:18 AM
What type of project are you going to use?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 05, 2011
04:58 AM
Hi Rakesh,
If you are using Installscript msi project, then create a custom dialog providing three options and depending upon the selection, launch respective exe.
Hope this helps
Thanks,
Gayathri
If you are using Installscript msi project, then create a custom dialog providing three options and depending upon the selection, launch respective exe.
Hope this helps
Thanks,
Gayathri
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 05, 2011
06:13 AM
gayathrim wrote:
Hi Rakesh,
If you are using Installscript msi project, then create a custom dialog providing three options and depending upon the selection, launch respective exe.
Hope this helps
Thanks,
Gayathri
Thanks Gayatri for your reply.
I am using installscript MSI project.I have already created custom dialog providing three options.But I don't know how to launch exe's based on selection through installscript and what shhould be the script.
Can you please help me about this.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 05, 2011
07:23 AM
Hi Rakesh,
Below is the sample code for dialog with 3 radio buttons as per ur requirement
**********************************************************
#define DIALOG_ID 12611 //define dialog id in properties
#define radiobutton1 1302 //radiobutton control id
#define radiobutton2 1303
#define radiobutton3 1304
#define BUT_BACK 12
#define BUT_NEXT 1
#define BUT_CANCEL 9
prototype Options();
BOOL bone, btwo, bthree;
function Options()
STRING szDialogName;
BOOL bDone;
NUMBER nResult, nCmdValue, returnVal, hInstance, nReturn, hwndDlg;
begin
// Specify a name to identify the custom dialog in this setup.
szDialogName = "Options";
// Define the dialog. Pass a null string in the second parameter
// to get the dialog from _isuser.dll or _isres.dll. Pass a null
// string in the third parameter because the dialog is identified
// by its ID in the fourth parameter.
nResult = EzDefineDialog(szDialogName, "", "", 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("Options"); //Options is the dialog name
// Respond to the event.
switch (nCmdValue)
case DLG_CLOSE:
Do (EXIT);
case DLG_ERR:
MessageBox ("Dialog failed.", SEVERE);
abort;
bDone = TRUE;
case DLG_INIT:
//write code on intialization
case radiobutton1:
bone = CtrlGetState("Options", radiobutton1);
case radiobutton2:
btwo = CtrlGetState("Options", radiobutton2);
case radiobutton3:
bthree = CtrlGetState("Options", radiobutton3);
case BUT_CANCEL: //Cancel button
Do(EXIT);
case BUT_BACK:
returnVal = 12;
bDone = TRUE;
case BUT_NEXT:
bone = CtrlGetState("Options", radiobutton1);
btwo = CtrlGetState("Options", radiobutton2);
bthree = CtrlGetState("Options", radiobutton3);
returnVal = 1;
bDone = TRUE;
endswitch;
until bDone;
// Close the dialog box.
EndDialog("Options");
// Free the dialog box from memory.
ReleaseDialog("Options");
return returnVal;
end;
**********************************************************
if you want to launch exe in the beginning, then in OnBegin event,
function OnBegin()
begin
nReturn = Options(); //custom dialog
if(nReturn = NEXT) then
//place your exes in SUPPORTDIR
if(bone = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "one.exe", WAIT);
elseif(btwo = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "two.exe", WAIT);
elseif(bthree = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "three.exe", WAIT);
endif;
endif;
end;
This is sample only please change accordingly.
Hope this helps
Thanks,
Gayathri
Below is the sample code for dialog with 3 radio buttons as per ur requirement
**********************************************************
#define DIALOG_ID 12611 //define dialog id in properties
#define radiobutton1 1302 //radiobutton control id
#define radiobutton2 1303
#define radiobutton3 1304
#define BUT_BACK 12
#define BUT_NEXT 1
#define BUT_CANCEL 9
prototype Options();
BOOL bone, btwo, bthree;
function Options()
STRING szDialogName;
BOOL bDone;
NUMBER nResult, nCmdValue, returnVal, hInstance, nReturn, hwndDlg;
begin
// Specify a name to identify the custom dialog in this setup.
szDialogName = "Options";
// Define the dialog. Pass a null string in the second parameter
// to get the dialog from _isuser.dll or _isres.dll. Pass a null
// string in the third parameter because the dialog is identified
// by its ID in the fourth parameter.
nResult = EzDefineDialog(szDialogName, "", "", 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("Options"); //Options is the dialog name
// Respond to the event.
switch (nCmdValue)
case DLG_CLOSE:
Do (EXIT);
case DLG_ERR:
MessageBox ("Dialog failed.", SEVERE);
abort;
bDone = TRUE;
case DLG_INIT:
//write code on intialization
case radiobutton1:
bone = CtrlGetState("Options", radiobutton1);
case radiobutton2:
btwo = CtrlGetState("Options", radiobutton2);
case radiobutton3:
bthree = CtrlGetState("Options", radiobutton3);
case BUT_CANCEL: //Cancel button
Do(EXIT);
case BUT_BACK:
returnVal = 12;
bDone = TRUE;
case BUT_NEXT:
bone = CtrlGetState("Options", radiobutton1);
btwo = CtrlGetState("Options", radiobutton2);
bthree = CtrlGetState("Options", radiobutton3);
returnVal = 1;
bDone = TRUE;
endswitch;
until bDone;
// Close the dialog box.
EndDialog("Options");
// Free the dialog box from memory.
ReleaseDialog("Options");
return returnVal;
end;
**********************************************************
if you want to launch exe in the beginning, then in OnBegin event,
function OnBegin()
begin
nReturn = Options(); //custom dialog
if(nReturn = NEXT) then
//place your exes in SUPPORTDIR
if(bone = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "one.exe", WAIT);
elseif(btwo = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "two.exe", WAIT);
elseif(bthree = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "three.exe", WAIT);
endif;
endif;
end;
This is sample only please change accordingly.
Hope this helps
Thanks,
Gayathri
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
07:58 AM
gayathrim wrote:
Hi Rakesh,
Below is the sample code for dialog with 3 radio buttons as per ur requirement
**********************************************************
#define DIALOG_ID 12611 //define dialog id in properties
#define radiobutton1 1302 //radiobutton control id
#define radiobutton2 1303
#define radiobutton3 1304
#define BUT_BACK 12
#define BUT_NEXT 1
#define BUT_CANCEL 9
prototype Options();
BOOL bone, btwo, bthree;
function Options()
STRING szDialogName;
BOOL bDone;
NUMBER nResult, nCmdValue, returnVal, hInstance, nReturn, hwndDlg;
begin
// Specify a name to identify the custom dialog in this setup.
szDialogName = "Options";
// Define the dialog. Pass a null string in the second parameter
// to get the dialog from _isuser.dll or _isres.dll. Pass a null
// string in the third parameter because the dialog is identified
// by its ID in the fourth parameter.
nResult = EzDefineDialog(szDialogName, "", "", 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("Options"); //Options is the dialog name
// Respond to the event.
switch (nCmdValue)
case DLG_CLOSE:
Do (EXIT);
case DLG_ERR:
MessageBox ("Dialog failed.", SEVERE);
abort;
bDone = TRUE;
case DLG_INIT:
//write code on intialization
case radiobutton1:
bone = CtrlGetState("Options", radiobutton1);
case radiobutton2:
btwo = CtrlGetState("Options", radiobutton2);
case radiobutton3:
bthree = CtrlGetState("Options", radiobutton3);
case BUT_CANCEL: //Cancel button
Do(EXIT);
case BUT_BACK:
returnVal = 12;
bDone = TRUE;
case BUT_NEXT:
bone = CtrlGetState("Options", radiobutton1);
btwo = CtrlGetState("Options", radiobutton2);
bthree = CtrlGetState("Options", radiobutton3);
returnVal = 1;
bDone = TRUE;
endswitch;
until bDone;
// Close the dialog box.
EndDialog("Options");
// Free the dialog box from memory.
ReleaseDialog("Options");
return returnVal;
end;
**********************************************************
if you want to launch exe in the beginning, then in OnBegin event,
function OnBegin()
begin
nReturn = Options(); //custom dialog
if(nReturn = NEXT) then
//place your exes in SUPPORTDIR
if(bone = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "one.exe", WAIT);
elseif(btwo = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "two.exe", WAIT);
elseif(bthree = BUTTON_CHECKED) then
LaunchAppAndWait("cmd /c ", SUPPORTDIR ^ "three.exe", WAIT);
endif;
endif;
end;
This is sample only please change accordingly.
Hope this helps
Thanks,
Gayathri
Thanks Gayatri for this sample code.
I am trying to use it in my sample app.But I have one query about location of source exe's.Where should I place them.And how should SUPPORTDIR is used to find those exe's and launch them.
Sorry for more queries.But as I am new to installer I am facing these kind of issues.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
08:07 AM
SUPPORTDIR is used when you include files in the Support Files/Billboard view.
The path to these files are retrieved at install time using SUPPORTDIR.
I would have done the following:
Create three features. One for each exe.
Just use AskOptions dialog in the appropriate way to display three options.
Use FeatureSelectItem function to select or deselect the feature according to the return values from the AskOptions dialog.
The path to these files are retrieved at install time using SUPPORTDIR.
I would have done the following:
Create three features. One for each exe.
Just use AskOptions dialog in the appropriate way to display three options.
Use FeatureSelectItem function to select or deselect the feature according to the return values from the AskOptions dialog.