public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Jon Beniston" <jon@beniston.com>
To: <cygwin@cygwin.com>
Subject: setup-x86.exe exits before installation is complete
Date: Thu, 06 Mar 2014 12:42:00 -0000	[thread overview]
Message-ID: <002301cf3936$2a25c7d0$7e715770$@beniston.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Hi,

It seems recent versions of setup-x86.exe exit before the installation is
complete. Without the --no-admin option, the main installation is run as a
child process, and the parent doesn't wait for the child to complete. This
can cause a bit of a problem for other installers that install Cygwin (as
when setup.exe exits, Cygwin isn't installed).

Is something like the attached patch appropriate? It just waits for the
child process before exiting.

Cheers,
Jon


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 850 bytes --]

Index: main.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/main.cc,v
retrieving revision 2.75
diff -u -r2.75 main.cc
--- main.cc	18 Nov 2013 11:16:14 -0000	2.75
+++ main.cc	6 Mar 2014 12:02:16 -0000
@@ -295,6 +295,7 @@
 		sei.lpVerb = "runas";
 		sei.lpFile = exe_path;
 		sei.nShow = SW_NORMAL;
+		sei.fMask |= SEE_MASK_NOCLOSEPROCESS;
 
 		// Avoid another isRunAsAdmin check in the child.
 		std::string command_line_cs (command_line);
@@ -322,6 +323,11 @@
 		  }
 		else
 		  exit_msg = IDS_ELEVATED;
+
+        // Wait until child process is finished
+		if (sei.hProcess != NULL)
+		  WaitForSingleObject (sei.hProcess, INFINITE);
+            
 		// Once we are set on course to privilege elevate, the parent
 		// process is unnecessary.
 		goto finish_up;


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2014-03-06 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 12:42 Jon Beniston [this message]
2014-03-07 16:28 ` Corinna Vinschen
2014-03-07 20:23 Jon Beniston
2014-03-10 14:28 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002301cf3936$2a25c7d0$7e715770$@beniston.com' \
    --to=jon@beniston.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).