X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=juuqAHSnn5OEy5qE Ik7NQQyHhxVfEOkC2NyU2bUVnJgrx87RTqao0C2gsRR6JT9vOUk9emjoEvKQcUHP KGQ8aY4Xep2qMNWJuoz2hmFPPMjS0t9NuLENgqQtai+uLFexKHHpSkbBxEObKycl 4LTWmSwSXxvljHkYRndLXoZskm0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=jLvEYWaKvvpewkfqi5A/mL i8xT0=; b=jm7MwjTVRxgTxU4bTkHBSBiSFTRvvPcOF9S3u0HGX/g0z1t3RVllH2 JxPJt9QEuIy92KliWIOGwc5635fvZemiWk+BwkV1t5ZX6/hLkGfGXhUiq2kQY+Pr ahZcjm72fSiQT5ewdq+p1xNSt0MTrR3xiHCMGl63ICVEHbnjTJtlg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=gui, GUI, H*UA:Bat!, H*x:Bat! X-HELO: forward102p.mail.yandex.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1530791401; bh=WAey5gJAGiAC8YIPda29TgSsdYBGFLCtM0VZ2q8l2b4=; h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References; b=F5nxEwroxa6COepvSNBDweeqF9VCR/GKlnmjTEZdTlAsEC+yAfZTXDCfQGRm/19j0 ufGk8eAtAsgevWSs2DsP0rUMWjBvF5Bmnl3n3bLjZQOu6a8CpVOHqA5Oza3eZdRija Pfos/X4lRou4nmQfgC1oIKyvSmP32qI4WRhzK2Ac= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1530791401; bh=WAey5gJAGiAC8YIPda29TgSsdYBGFLCtM0VZ2q8l2b4=; h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References; b=F5nxEwroxa6COepvSNBDweeqF9VCR/GKlnmjTEZdTlAsEC+yAfZTXDCfQGRm/19j0 ufGk8eAtAsgevWSs2DsP0rUMWjBvF5Bmnl3n3bLjZQOu6a8CpVOHqA5Oza3eZdRija Pfos/X4lRou4nmQfgC1oIKyvSmP32qI4WRhzK2Ac= Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Thu, 5 Jul 2018 14:44:21 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <1431281324.20180705144421@yandex.ru> To: Ken Brown , cygwin AT cygwin DOT com Subject: Re: Unattended upgrade does not report errors via the exit code In-Reply-To: <161257fb-c7e8-e767-752f-40dc367cf7bf@cornell.edu> References: <693796192 DOT 3838665 DOT 1530640512441 DOT ref AT mail DOT yahoo DOT com> <693796192 DOT 3838665 DOT 1530640512441 AT mail DOT yahoo DOT com> <126e0d40-4dd2-126d-b54c-7ddc27d008b8 AT cornell DOT edu> <7a9215c3-a895-b935-a843-e47b4135f138 AT tiscali DOT co DOT uk> <161257fb-c7e8-e767-752f-40dc367cf7bf AT cornell DOT edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w65BoKEo017351 Greetings, Ken Brown! > On 7/4/2018 6:25 PM, David Stacey wrote: >> On 04/07/18 19:59, Ken Brown wrote: >>> On 7/3/2018 1:55 PM, R. Diez via cygwin wrote: >>>> I tried printing $? from a Cygwin shell afterwards, and %ERRORLEVEL% >>>> in a Windows console, and it always showed an exit status of 0. >>> >>> setup is a Windows program, not a Cygwin application, so I don't think >>> you can expect $? to contain its exit status.  I don't know enough >>> about Windows programming to know what would have to be changed in the >>> setup sources to support %ERRORLEVEL%. >> >> %ERRORLEVEL% is the return code from the last programme or script to >> execute. Provided that setup exits with zero on success and non-zero on >> an error condition, there's nothing extra to be done. > According to > https://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line/11476681#11476681, > that's not true for windowed applications, Karmaoverflow is not the authoritative source of information. The key word is "directly in the command line". CMD checks if application you are starting is console or not and abandon process control for perceived GUI apps. But if you run application from batch file, it will treat all of them equal. > but it is true if the > application is started via 'start /wait'. I haven't tested this. Unless application explicitly detach from parent process, or parent process explicitly exec the child with no process control, there's no difference. exit(n) is the same function, not dependent on the type of application. -- With best regards, Andrey Repin Thursday, July 5, 2018 14:08:05 Sorry for my terrible english... -- 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