
lapsap7+is1.552492869319952E12 asked a question.
Possible NOT to allow "modify" and "repair" on running the setup?
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
Doing so just remove the "Change" button in "Add or Remove Programs" window, as I had already written in my original post.
Hope this helps.
I'd rather expect that we could using parameters other than doing this low-level change.
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.
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.
" mitutoyo wrote:
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.