0

this is a simplistic example of my problem:

I have this simple bundle

<Chain>
  <ExePackage SourceFile="C:\Users\this\Desktop\AAA\eee.exe"></ExePackage>
</Chain>

the eee.exe is the result of IEXPRESS of two files

  • eee.bat
  • eee.txt

IEXPRESS runs cmd /c eee.bat

eee.bat do some stuff then finishes with this line

shutdown -r -f -t 0

once the result of the Wix, the installer, is run it forces the reboot then rerun the instller

how can we change the behaviour of this so it will not rerun the installer after the reboot

Hassan
  • 313
  • 1
  • 2
  • 12
  • Change whatever part of your code reruns the installer after reboot. It's not in the code you've posted. Try searching in eee.bat. – jmoon Aug 18 '17 at 00:11
  • its the very probably that the "shuthown -r -f -t 0" interopt the wix installer, so windows thinks that the installation is not finished yet, and after reboot he launched it again. – Hassan Aug 18 '17 at 00:16
  • Ah, so you want to kill the process before shutdown. https://stackoverflow.com/questions/2888851/how-to-stop-process-from-bat-file – jmoon Aug 18 '17 at 00:31
  • we tryed that, still relaunch the installer after reboot. – Hassan Aug 18 '17 at 00:36
  • Are you cleanly killing all processes associated with the installer? – jmoon Aug 18 '17 at 00:37
  • 2
    Killing the installer from your bat is almost certainly bad behaviour – Brian Sutherland Aug 18 '17 at 15:53
  • 1
    You should probably be using the LaunchTarget functionality of the bootstrapper. This happens after the install is complete and won't restart the install after the machine reboots. http://wixtoolset.org/documentation/manual/v3/xsd/bal/wixstandardbootstrapperapplication.html – Brian Sutherland Aug 18 '17 at 15:56

1 Answers1

2

Forcing a restart in the middle of your installation is not good practice. As comments to your post pointed out, you are interrupting your own installer. Instead, you can use a successful exit code (0) to tell your installer to reboot.

<Chain>
   <ExePackage SourceFile="C:\Users\this\Desktop\AAA\eee.exe">
      <ExitCode Value="0" Behavior="forceReboot"/>
  </ExePackage>
</Chain>

Don't forget to take the shutdown line out of the BAT file.

philselmer
  • 751
  • 4
  • 22
  • doing just that, it still relaunch the installer after the reboot. it relaunch two instances!! – Hassan Aug 23 '17 at 00:00
  • Did you remove the shutdown command from the compiled batch file? If you did and it's still relaunching the installer, you should post the rest of the code so we can help figure out why it's restarting. – philselmer Aug 23 '17 at 12:18