cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
ralphster
Active participant

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

Accepted Solutions
Flexera banna_k
Flexera

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

Jump to 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.

 

 

13 Replies
Flexera banna_k
Flexera

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

Jump to solution

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
ralphster
Active participant

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

Jump to solution

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
Flexera banna_k
Flexera

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

Jump to solution

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
ralphster
Active participant

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

Jump to solution

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
Flexera banna_k
Flexera

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

Jump to solution

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
ralphster
Active participant

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

Jump to solution

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
Flexera banna_k
Flexera

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

Jump to solution
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
ralphster
Active participant

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

Jump to solution

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
Flexera banna_k
Flexera

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

Jump to solution

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