Reputation: 1175
I created an installer that only provides you an uninstall option when you right-click on the program name in the 'Add/Remove Programs' of the Control Panel.
However, the problem is that:
1 ) if you right-click the msi after you have installed the program, it displays the context menu, providing you Install/Repair options...
2 ) It also prompts you a maintenance dialog with Change/Repair options if you double-click the exe.
My question is how can I disable these functionality/options? Wrapping a msi in exe file isn't the option for us.
I have looked into one question that is quite similar to mine: Remove repair option screen from MSI installer but can not seem to figure it out.
For #2, I have found an answer here: http://justinyue.wordpress.com/2008/12/16/how-to-skip-the-maintainancetype-dialog-in-basic-msi-project/
I just skipped the maintainancetype dialog. Still need an answer for #1..
Upvotes: 0
Views: 2158
Reputation: 55620
I'm sure you could come up with a Type 19 error CA or Launch Condition that blocks the install when doing a repair. Some conditions based on properties should do the trick.
But the real question is, why? I can only imagine you are trying to cover up some root problem in your installer. "Repair" isn't the only way a repair can get invoked. You can run it from the command or it can be trigged via shortcuts or COM activation.
The real fix is to address your repair not working. Frequently this is due to someone not understanding that properties aren't persisted so they get nulled out after the repair.
Upvotes: 0
Reputation: 15905
Don't try to solve #1. To do this you would have to break the registration for all .msi
files on the machine in question, and no end user should have to put up with an application breaking their machine.
For #2, you can tweak your own dialogs or dialog sequences to provide the maintenance experience you desire (InstallUISequence
and ControlEvent
entries in a Basic MSI project; OnFirstUIBefore
/OnMaintUIBefore
code in InstallScript based UIs) as you allude to. Note that significant changes may confuse your users if the behavior doesn't match their expectations, but just removing "repair" isn't too huge.
But why not just fix repair?
Upvotes: 2