public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: setup-x86.exe exits before installation is complete
@ 2014-03-07 20:23 Jon Beniston
  2014-03-10 14:28 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Beniston @ 2014-03-07 20:23 UTC (permalink / raw)
  To: cygwin

>> 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.
>
>Why don't you just run your installer as admin and use the --no-admin
>option?

I can't immediately see a way to do that with the installer package I'm
using, but I can probably find a workaround.

However, I thought the patch might be useful for anyone else who also
installs Cygwin via some form of script or installer, as this reverts the
default behaviour to as it was until recently.

Cheers,
Jon



--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: setup-x86.exe exits before installation is complete
  2014-03-07 20:23 setup-x86.exe exits before installation is complete Jon Beniston
@ 2014-03-10 14:28 ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2014-03-10 14:28 UTC (permalink / raw)
  To: cygwin

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

On Mar  7 18:09, Jon Beniston wrote:
> >> 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.
> >
> >Why don't you just run your installer as admin and use the --no-admin
> >option?
> 
> I can't immediately see a way to do that with the installer package I'm
> using, but I can probably find a workaround.
> 
> However, I thought the patch might be useful for anyone else who also
> installs Cygwin via some form of script or installer, as this reverts the
> default behaviour to as it was until recently.

"Recently" is more than three months ago...

It's kind of annoying having two setup processes in memory for no
apparentl reason.  However, I see your point.  Therefore I applied
a variation of your patch which waits for the elevated child if the
-W or --wait option is ginve on the command line.


Hope that helps,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: setup-x86.exe exits before installation is complete
  2014-03-06 12:42 Jon Beniston
@ 2014-03-07 16:28 ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2014-03-07 16:28 UTC (permalink / raw)
  To: cygwin

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

On Mar  6 12:18, Jon Beniston wrote:
> 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.

Why don't you just run your installer as admin and use the --no-admin
option?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* setup-x86.exe exits before installation is complete
@ 2014-03-06 12:42 Jon Beniston
  2014-03-07 16:28 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Beniston @ 2014-03-06 12:42 UTC (permalink / raw)
  To: cygwin

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-10 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07 20:23 setup-x86.exe exits before installation is complete Jon Beniston
2014-03-10 14:28 ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2014-03-06 12:42 Jon Beniston
2014-03-07 16:28 ` Corinna Vinschen

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).