cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ralphster
Level 6

How to prevent "Modify, repair, or remove the program"

Jump to solution

I have an installshield project which I use to collect some user information through text boxes, and then finally run a batch file using the "LaunchAppAndWait" function call. All works well except that if I run the installshield installation a second time,  a  dialog box is displayed with radio buttons asking me to select whether to "Modify", "Repair", or "Remove" the program. 

How do I prevent this dialog box from displaying? t is not needed, since my project does not actually install any files. As I said, it just calls a batch file which already exists in a target directory.

Labels (1)
0 Kudos
(1) Solution

Hi @ralphster ,

 

You can customize the things how you want to execute during the maintenance operation, if you want to do exactly what you are configured in function OnFirstUIBefore() then you can call all that functions from OnMaintUIBefore like below to popup the new dialog:

 

function OnMaintUIBefore()
number nResult, nType;
string szTitle, szMsg;
begin

// nType defaults to MODIFY.
nType = MODIFY;

//Initialize SQL
OnSQLServerInitializeMaint();

// Beginning of UI Sequence
Dlg_Start:

// Added in Version 9.5 - Support for REMOVEONLY option.
if( !REMOVEONLY ) then
// In standard mode show maintenance dialog
Disable( BACKBUTTON );
//nType = SdWelcomeMaint( szTitle, szMsg, nType ); // Hey Banna, commenting this out did not work, nor did setting it to REPAIR Please help!

Enable( BACKBUTTON );
nResult = NEXT;
szTitle = "Simple Dialog";
szMsg ="Enter the name";
nResult = dlgSimpleDialog();
FeatureReinstall();
return;

else
// Hide the initial progress dialog as otherwise the user can
// click on it, and hide the MessageBox.
Disable( DIALOGCACHE );

// In RemoveOnly mode, set to remove.
nType = REMOVEALL;
endif;

// Show Uninstall Confirmation Dialog
if ( nType = REMOVEALL ) then

....... continues till end.

 

And if you do not want to get the  Maintenance complete dialog box in this particular scenario, you can customize that also in OnMaintUIAfter function as in the attached screen shot image.

 

 

View solution in original post

(13) Replies
banna_k
Revenera
Revenera

Hi @ralphster ,

 

Looks like you are using installscript msi project, in that case you can remove sdWelcomeMaint dialog by modifying the code in the attached image code.

 

0 Kudos

Thanks for the information Banna. I commented out the line of code:

nType = SdWelcomeMaint(szTitle, szMsg, MODIFY):

And that did not fix the issue. Do you have any further information which can help me out? As I mentioned before, my project does not need to uninstall any previous installations, because it is not installing any files.

0 Kudos

Hi @ralphster ,

 

I am not getting the "Modify, repair, or remove the program" dialog if I comment the code like below:

//nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
nType = REPAIR;

Hope you are using Installscript msi project.

When execute next time after first installation, I am not getting the "Modify, repair, or remove the program" dialog. 

After commenting, you can initialize the nType = REPAIR; to repair.

Can you check it again after rebuilding your with the above change.

1- Rebuild your installscript project with the above change

2 install the new setup built

3 Again, try to install the new setup. hope your are not able to see the "Modify, repair, or remove the program"  dialog.

0 Kudos

Hi Banna,

I am still having the same issue.

Also as a separate test I created a brand new InstallShield project ("InstallScript MSI Project"), This new project is very small and only opens two dialog boxes and no custom dialog boxes. In this new project I also commented out SdWelcomeMaint and the same issue is still occurring. I am stuck, so your help is really appreciated. Below is the very simple code SetupRul from the test project I created today. As you can see it is very simple. Yet I am still having the same issue.

#include "ifx.h"

function OnFirstUIBefore()
string szTitle, szDir, szMsg;
number nResult;

begin
Dlg_SdWelcome:
szTitle = "Test Installation";
szMsg= "First Dialog Box";
nResult = sdWelcome(szTitle,szMsg);

Dlg_SdAskDestPath:
szTitle = "Ask Destination Path";
szMsg = "Second Dialog";
nResult = SdAskDestPath(szTitle,szMsg,szDir,0);
return nResult;
end;

 

 

function OnMaintUIBefore()

//nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
nType = REPAIR;

0 Kudos

Hi @ralphster ,

I just commented the line what I said in the previous comment, after that If I execute the setup.exe second time I am not getting the "Modify, repair, or remove the program".

So in order to check the code compiled properly, can you add a message box  in "function OnMaintUIBefore()" just before the "nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);"

 

MessageBox("OnMaintUIBefore", MB_OK);

nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);

Then build the setup again, and see whether you are getting the message box on installing the setup.exe second time.

if you are getting the message box, then comment the below line again and see whether you are getting the "Modify, repair, or remove the program" on your second time execution of the setup.exe

//nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
nType = REPAIR;

 

if the above case is not working, go to the dialog source  from the top drop down box and SdWelcomeMaint function and modify the code like below:

function SdWelcomeMaint(szTitle, szMsg, nType)
string szDlg, szTemp, szType;
number nId, nTemp, nSdDialog;
HWND hwndDlg;
BOOL bDone;
begin

nId = REPAIR;
return nId;   // Made to return here without displaying the dialog. reaming code will continue.

// record data produced by this dialog
if(MODE=SILENTMODE) then
SdMakeName( szAppKey, szDlg, szTitle, nSdWelcomeMaint );
SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
return nId;
endif;

...

...

...

0 Kudos

Hello Banna,

Setting nType = REPAIR is  leading to the invocation of dialog boxes to repair the previous installation right? That is not what I need. I just want the product to reinstall and never to prompt to fix, repair or remove the previous installation. How can I do that?

I tried your suggestions and all of them will display a dialog box which either indicates that a repair, or upgrade will occur. I tried this with the simplest InstallShield project and it is still not working. Your help is deeply appreciated. Is there another expert whom you can ask about this?

0 Kudos
Hi @ralphster,
So can you share your sample installshield project you created through the private message option.
And just to confirm again the use case:
1 - First you have Installed the setup.exe( built using installscrpt msi project)
2- Again you are trying to execute the same setup.exe( last time built and installed setup.exe ). In this case, you are getting the "Modify, repair or remove the program" dialog. So you do not want to get this dialog here, and what operation you are expecting to execute during this case.
0 Kudos

Hell Banna. Attached is my project which is zipped up. It is just a very simple project which will illustrate what I am talking about. 

1. Yes I have installed the setup.exe (built using installscript msi project)

2. Yes I need to be able to repeatedly run setup.exe and to have it reinstall the product without being prompted to remove or repair the previous installation.

 

 

 

The same issue is happening for both Installshield 2019, and 2016.

 

0 Kudos

Hi @ralphster ,

 

  Ok, you are using Installscript project for building the setup.exe (Installshield is having Installscript MSI project also ).

So, can you modify the code like below:

 

function OnMaintUIBefore()
number nResult, nType;
string szTitle, szMsg;
begin

// nType defaults to MODIFY.
nType = MODIFY;

//Initialize SQL
OnSQLServerInitializeMaint();

// Beginning of UI Sequence
Dlg_Start:

// Added in Version 9.5 - Support for REMOVEONLY option.
if( !REMOVEONLY ) then
// In standard mode show maintenance dialog
Disable( BACKBUTTON );
//nType = SdWelcomeMaint( szTitle, szMsg, nType ); // commented
Enable( BACKBUTTON );
nResult = NEXT;
FeatureReinstall();  // added these line to simply reinstall the features
return;  // ending the method here
else
// Hide the initial progress dialog as otherwise the user can
// click on it, and hide the MessageBox.
Disable( DIALOGCACHE );

// In RemoveOnly mode, set to remove.
nType = REMOVEALL;
endif;

  

0 Kudos

Hi Banna,

 

I get three compiler errors. It looks line the two functions are not defined and the return is not returning a value. Which value should it return? should it return "nResult"? Also it appears that the two functions you listed are not defined?

OnSQLServerInitiallizeMaint() : undefined identifier

FeatureReinstall(): undefined identifier

return;  : Error, should return a value

0 Kudos

Hi @ralphster ,

 

 I am wondering how you are getting these three compilation errors,  all those listed methods not defined newly. it was there previously in your attached project. And, its all defined in installshield library.

So can you check attached project, simply extract in your Installshield 2019 machine.

Before building the project go to the extracted location "..\InstallShield 2019 Projects\TestProject\Media\Release 1\Disk Images\Disk1" folder, and see the behavior of the setup.exe by installing it from there and then execute the setup.exe again to verify the behavior in maintenance mode.

 

Then try to build the project using Installshield 2019, I was able to build the project without any errors and able to create the setup.exe out of it.

The changes made to your projects are below:

1- Go to the function OnMaintUIBefore() in script view

2-  Then commented the below line

//nType = SdWelcomeMaint( szTitle, szMsg, nType ); // Hey Banna, commenting this out did not work, nor did setting it to REPAIR Please help!

Enable( BACKBUTTON );
nResult = NEXT;

3- Added the below two line just below the lines mentioned in the above.
FeatureReinstall();
return;  // If the return is asking to return a value, you can return 0; also

 

InstallShield 2019 build-able project is attached here: 

 

0 Kudos

Hi Banna. The project you attached installs successfully the first time. After that it will not reinstall. It will eventually display a Maintenance complete dialog box, but that is as far as it will go. So still no solution?

0 Kudos

Hi @ralphster ,

 

You can customize the things how you want to execute during the maintenance operation, if you want to do exactly what you are configured in function OnFirstUIBefore() then you can call all that functions from OnMaintUIBefore like below to popup the new dialog:

 

function OnMaintUIBefore()
number nResult, nType;
string szTitle, szMsg;
begin

// nType defaults to MODIFY.
nType = MODIFY;

//Initialize SQL
OnSQLServerInitializeMaint();

// Beginning of UI Sequence
Dlg_Start:

// Added in Version 9.5 - Support for REMOVEONLY option.
if( !REMOVEONLY ) then
// In standard mode show maintenance dialog
Disable( BACKBUTTON );
//nType = SdWelcomeMaint( szTitle, szMsg, nType ); // Hey Banna, commenting this out did not work, nor did setting it to REPAIR Please help!

Enable( BACKBUTTON );
nResult = NEXT;
szTitle = "Simple Dialog";
szMsg ="Enter the name";
nResult = dlgSimpleDialog();
FeatureReinstall();
return;

else
// Hide the initial progress dialog as otherwise the user can
// click on it, and hide the MessageBox.
Disable( DIALOGCACHE );

// In RemoveOnly mode, set to remove.
nType = REMOVEALL;
endif;

// Show Uninstall Confirmation Dialog
if ( nType = REMOVEALL ) then

....... continues till end.

 

And if you do not want to get the  Maintenance complete dialog box in this particular scenario, you can customize that also in OnMaintUIAfter function as in the attached screen shot image.