4

I'm interested in creating a mock wix installer which can be used to simulate an installation that returns error code 3010. Is there a way to get a wix installation to easily return a specific error code. Would simply returning 3010 from a custom action work? or would that just be a failed custom action?

Any suggestions welcome! Thanks Ben

Ben Cawley
  • 1,606
  • 17
  • 29

2 Answers2

3

Despite searching on SO before posting, I have subsequently found this answer.

Is it possible to prompt for restart machine after installation using WiX?

The line:

<InstallExecuteSequence>
      <ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>

does the trick and returns 3010!

Community
  • 1
  • 1
Ben Cawley
  • 1,606
  • 17
  • 29
  • 1
    You might also want to remove certain standard actions from that fake install so that it doesn't actually register itself with MSI and Add/Remove Programs. Otherwise you'll have to first uninstall it every time you want to test installing it. – Christopher Painter Dec 22 '11 at 19:19
0

How did you verify that the MSI returns 3010 ? I tried this out and the MSI just reboots at the end. I was expecting the MSI to just return 3010 and it should be upto the environment to decide whether to reboot now or later.

Pradeep
  • 731
  • 1
  • 7
  • 13
  • If you turn on logging you can see that the msi returns 3010 success code which tells the operating system to reboot. If you don't want that to happen then you'll need to suppress the reboot via the command line. – Ben Cawley Apr 12 '12 at 07:55
  • Thanks Ben, I couldn't see the MSI returning 3010 in the log file. I use the command msiexec /i MyMsi.msi /q /log logfile.txt – Pradeep Apr 12 '12 at 23:08
  • try msiexec -i mymsi.msi /q /lv*x logfile.txt – Ben Cawley Apr 13 '12 at 08:14