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
- :
- problem with SdShowDlgEdit2 ()
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
May 21, 2008
01:57 PM
problem with SdShowDlgEdit2 ()
Hi Sir
as you said last time that i can either use askagain() or SdShowDlgEdit2 ().
i used SdShowDlgEdit2 () to develop my application.It accepts the value from the user and copy it to AUTOEXEC.BAT.
(I am workin in Basic MSI)..
I created dialog box with above mention function ,fetch the values from user and pass it to EzBatchAddString() .
I build the release and run the set up file.It shows the dialog box(SdShowDlgEdit2 ()) after the files have been installed and moved.
when i modify the script for the second time and build the release again,the setup file cause error.
1.Either the setup file get struck into some infinite loop and the setup dialog blinks at a very fast pace
2.If it aint stuck into infinte loop it shows my dialog box (SdShowDlgEdit2 ()) ) before the installation and for second time after installation.so it modifies AUTOEXEC.BAT twice.....
I want to see my dialog box only at the end of installtion..
here is my code.can you tell me what is the error ..although my scripts compile successfully each time i compile..
#include "ifx.h"
#define BATCH_FILE "C:\\AUTOEXEC.bat"
#define MSG_TEXT "please enter the Server Name"
#define DEFAULT_COMPANY "t1"
#define ENV_TEMP "ComputerName"
export prototype MyFunction(HWND);
//of ask text function
//STRING svCompany, szTitle;
// NUMBER nResult;
//of Ez Batch add String
STRING szLine, szRefKey;
NUMBER nOptions;
STRING szTitle, szMsg, szField1, szField2, svEdit1, svEdit2;
STRING svValue;
function MyFunction(hMSI)
begin
// SetDialogTitle ( DLG_ASK_TEXT, "AUTOEXEC" );
// nResult = AskText (MSG_TEXT, DEFAULT_COMPANY, svCompany);
// if nResult = NEXT then
// MessageBox ("value: " + svCompany, INFORMATION);
// endif;
Disable (BACKBUTTON);
szTitle = "AUTOEXEC";
szMsg = "please enter the INFORMATION";
szField1 = "SERVER:";
szField2 = "STORE No.:";
GetEnvVar ( ENV_TEMP, svValue );
svEdit1=svValue;
if (SdShowDlgEdit2 (szTitle, szMsg, szField1, szField2,svEdit1, svEdit2) < 0) then
MessageBox ("SdShowDlgEdit2 failed.", SEVERE);
endif;
// Set the default batch file.
BatchSetFileName (BATCH_FILE);
// Set up parameters for next call to EzBatchAddString.
szLine = "ALLServer= \\\\" + svEdit1 + "\\c";
szRefKey = "";
nOptions = AFTER;
if(EzBatchAddString (szLine, szRefKey, nOptions) <0) then
MessageBox ("First call to EzBatchAddString failed.", SEVERE);
endif;
szLine = "ALLStore=" + svEdit2;
if(EzBatchAddString (szLine, szRefKey, nOptions) <0) then
MessageBox ("First call to EzBatchAddString failed.", SEVERE);
endif;
end;
as you said last time that i can either use askagain() or SdShowDlgEdit2 ().
i used SdShowDlgEdit2 () to develop my application.It accepts the value from the user and copy it to AUTOEXEC.BAT.
(I am workin in Basic MSI)..
I created dialog box with above mention function ,fetch the values from user and pass it to EzBatchAddString() .
I build the release and run the set up file.It shows the dialog box(SdShowDlgEdit2 ()) after the files have been installed and moved.
when i modify the script for the second time and build the release again,the setup file cause error.
1.Either the setup file get struck into some infinite loop and the setup dialog blinks at a very fast pace
2.If it aint stuck into infinte loop it shows my dialog box (SdShowDlgEdit2 ()) ) before the installation and for second time after installation.so it modifies AUTOEXEC.BAT twice.....
I want to see my dialog box only at the end of installtion..
here is my code.can you tell me what is the error ..although my scripts compile successfully each time i compile..
#include "ifx.h"
#define BATCH_FILE "C:\\AUTOEXEC.bat"
#define MSG_TEXT "please enter the Server Name"
#define DEFAULT_COMPANY "t1"
#define ENV_TEMP "ComputerName"
export prototype MyFunction(HWND);
//of ask text function
//STRING svCompany, szTitle;
// NUMBER nResult;
//of Ez Batch add String
STRING szLine, szRefKey;
NUMBER nOptions;
STRING szTitle, szMsg, szField1, szField2, svEdit1, svEdit2;
STRING svValue;
function MyFunction(hMSI)
begin
// SetDialogTitle ( DLG_ASK_TEXT, "AUTOEXEC" );
// nResult = AskText (MSG_TEXT, DEFAULT_COMPANY, svCompany);
// if nResult = NEXT then
// MessageBox ("value: " + svCompany, INFORMATION);
// endif;
Disable (BACKBUTTON);
szTitle = "AUTOEXEC";
szMsg = "please enter the INFORMATION";
szField1 = "SERVER:";
szField2 = "STORE No.:";
GetEnvVar ( ENV_TEMP, svValue );
svEdit1=svValue;
if (SdShowDlgEdit2 (szTitle, szMsg, szField1, szField2,svEdit1, svEdit2) < 0) then
MessageBox ("SdShowDlgEdit2 failed.", SEVERE);
endif;
// Set the default batch file.
BatchSetFileName (BATCH_FILE);
// Set up parameters for next call to EzBatchAddString.
szLine = "ALLServer= \\\\" + svEdit1 + "\\c";
szRefKey = "";
nOptions = AFTER;
if(EzBatchAddString (szLine, szRefKey, nOptions) <0) then
MessageBox ("First call to EzBatchAddString failed.", SEVERE);
endif;
szLine = "ALLStore=" + svEdit2;
if(EzBatchAddString (szLine, szRefKey, nOptions) <0) then
MessageBox ("First call to EzBatchAddString failed.", SEVERE);
endif;
end;
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 21, 2008
03:21 PM
As we discussed [post=415133]here[/post], for a Basic MSI project you're much better off creating an MSI dialog box instead of using SdShowDlgEdit2 or any other InstallScript dialog box.
If you can't use the Environment Variables view to write data to the environment variables (which is far preferable), you can later use MsiGetProperty in your custom action to read the user's input, and then call your other functions to write to the text file.
If you can't use the Environment Variables view to write data to the environment variables (which is far preferable), you can later use MsiGetProperty in your custom action to read the user's input, and then call your other functions to write to the text file.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)