0

I'm using WixSharp for building a windows service installer.

I want to disable repair option.

using those properties remove the option from the Control Panel ONLY.

"ARPNOREPAIR" , "ARPNOMODIFY"

Is there a way to disable repair from the CMD and right click on *.msi->repair?

R.P
  • 171
  • 1
  • 11

1 Answers1

1

No. MSI repair can never be fully disabled. The best practice is to account for this and design/test accordingly.

If your problem is the username/password is being set back then you can put conditions on the CreateServices to not run during a repair.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Can't I do some abort to installations that detect as repair? Is there a way in wix to detect it? – R.P Oct 14 '21 at 14:38
  • sure but that would be a horrible user experience. It would still try to do a repair and then come back and say it failed. – Christopher Painter Oct 14 '21 at 14:47
  • do you think it's better practice to have it disable partially than abort? – R.P Oct 14 '21 at 15:18
  • That's what disable repair and it's really not great user friendly.. Thanks to @oleg-shilo installer.Load += e => { if (e.IsRepairing) { MessageBox.Show("Repair is not supported"); e.Result = ActionResult.UserExit; } }; – R.P Oct 16 '21 at 20:10