PDA

View Full Version : Possible NOT to allow "modify" and "repair" on running the setup?



seaktf
10-25-2010, 12:40 PM
I'm making a very simple InstallScript project which installs a set of files and then runs a command to install the service. And during uninstallation, another command is run before removing files.

I need it to be simple: so only the "Remove" button is allowed to display in "Add or Remove Programs" window.

However, I've just found that if the user runs the setup.exe once again, he has the "Modify, repair, or remove the program" dialog! Is it possible NOT to display this dialog? Or display a dialog which only allows "Remove" or "Cancel"?

TIA

mitutoyo
10-25-2010, 03:31 PM
In the General Information section, Add or Remove Programs area, if you set the Disable Change Button property to YES, would this not resolve your issue?

seaktf
10-26-2010, 05:04 AM
No.

Doing so just remove the "Change" button in "Add or Remove Programs" window, as I had already written in my original post.

rrinblue22
10-26-2010, 12:30 PM
You can edit the Maintenance dialog and delete the Radio button 'Modify' and 'Repair'. This would just display the Remove button.

Hope this helps.

seaktf
10-27-2010, 07:51 AM
No, not really.

I'd rather expect that we could using parameters other than doing this low-level change.

mitutoyo
10-27-2010, 10:21 AM
So when a user launches setup.exe on a machine that already has your product installed, you would like it to behave in the same way as if the user was in Add/Remove Programs (remove only option)?

In that case, your best bet may be to modify the OnMaintUIBefore event so it is forced into the REMOVEALL branch of code. Of course, if you are using the program . . . endprogram stream you'll have to call the event explicitly, probably based on the MAINTENANCE property.

Hope this helps.

seaktf
10-28-2010, 04:37 AM
So when a user launches setup.exe on a machine that already has your product installed, you would like it to behave in the same way as if the user was in Add/Remove Programs (remove only option)?

Yes, exactly.


In that case, your best bet may be to modify the OnMaintUIBefore event so it is forced into the REMOVEALL branch of code. Of course, if you are using the program . . . endprogram stream you'll have to call the event explicitly, probably based on the MAINTENANCE property.

I've just taken a look at OnMaintUIBefore. That's quite a long function. But I suppose I just need to change
nType = MODIFY;
to
nType = REMOVEALL;
at the very beginning of the function.

mitutoyo
11-01-2010, 05:08 PM
Either that or remove all code that doesn't relate to REMOVEALL. Since you are running program . . . endprogram, you have complete control over the function since Installshield will never automatically execute it.