Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute another NSIS installer and wait for it to finish?

I'm writing an installer in NSIS, which is kind of a wrapper for another installer, created with NSIS. The inner installer is not mine. It's created with BioWare Installer 1.03 (NSIS 2.34). It may be broken somehow, but I can't modify it! What my installer does is that it simply modifies some registry values (otherwise the "inner" installer won't run), then executes the installer, then overwrites some files and then restores the previous registry values.

My problem: I have no idea how to actually wait for the "inner" installer to finish! It's because the installer first unpacks it's content and creates a new process, which is the real installer. And the code executes as soon as the first process (unpacking) finishes. Waiting is crucial here, because I need to overwrite some files.

I have read this: http://nsis.sourceforge.net/When_I_use_ExecWait,_it_doesn't_wait, but I can't find any switches for NSIS installer.

I have tried ExecWait and nsExec::Exec, but none of them waits for the real installer, just for the first process to finish.

like image 604
Jakub Gocławski Avatar asked Nov 30 '25 03:11

Jakub Gocławski


1 Answers

First off, I have never seen ExecWait fail, but it will only wait for a child process, not the child of that child process. So every process in the chain needs to wait for its child. If the "middle" process is broken, try http://nsis.sourceforge.net/ExecWait_and_waiting_for_child_processes_with_Job_Objects

For ExecWait, the tree would look like:

  • NSIS1.exe: ExecWait NSIS2.exe
    • NSIS2.exe: ExecWait RealSetup.exe
      • RealSetup.exe: ...

Your description is a little unclear, can you confirm that I got the general idea?

If you could not find the switches for NSIS it means you did not RTFM :)

like image 108
Anders Avatar answered Dec 03 '25 06:12

Anders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!