Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 255031259185 for ; Fri, 27 Jan 2012 16:47:20 -0400 (AST) Received: from omr3.networksolutionsemail.com ([205.178.146.53]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RqshZ-0002nv-6u for pgsql-bugs@postgresql.org; Fri, 27 Jan 2012 20:47:20 +0000 Received: from cm-omr11 (mail.networksolutionsemail.com [205.178.146.50]) by omr3.networksolutionsemail.com (8.13.6/8.13.6) with ESMTP id q0RKl4Is001361 for ; Fri, 27 Jan 2012 15:47:04 -0500 Authentication-Results: cm-omr11 smtp.user=eborts@bltek.com; auth=pass (CRAM-MD5) X-Authenticated-UID: eborts@bltek.com Received: from [64.25.231.138] ([64.25.231.138:51448] helo=[192.168.2.112]) by cm-omr11 (envelope-from ) (ecelerity 2.2.2.41 r(31179/31189)) with ESMTPSA (cipher=AES256-SHA) id C3/62-25300-74D032F4; Fri, 27 Jan 2012 15:47:03 -0500 Message-ID: <4F230D46.2010200@bltek.com> Date: Fri, 27 Jan 2012 13:47:02 -0700 From: Eric Borts User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Dharmendra Goyal CC: Dave Page , pgsql-bugs@postgresql.org Subject: Re: Windows x86-64 One-Click Install (9.1.2-1, 9.0.6-1) hangs on "initialising the database cluster" (with work-around) References: <4F209FF1.3080209@bltek.com> <4F219D77.9050800@bltek.com> <4F21A163.8060004@bltek.com> <4F22FBC7.2000902@bltek.com> <4F22FDD8.1020708@bltek.com> <4F230600.7030902@bltek.com> In-Reply-To: <4F230600.7030902@bltek.com> Content-Type: multipart/alternative; boundary="------------070100060707040300010009" X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/207 X-Sequence-Number: 32274 This is a multi-part message in MIME format. --------------070100060707040300010009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The installation now runs successfully after deleting that registry key. In addition, I tried changing the default action on batch files from "Open" to "Edit" using the registry (Windows 7). Double-clicking a file opens it in Notepad, but the installation runs successfully. So it looks like the UserChoice registry key, however it got there, is the essence of the problem. Which, of course, %COMSPEC% /c would avoid because the program handling batch files is explicit. Thanks, Eric On 1/27/2012 1:16 PM, Eric Borts wrote: > I found the problem with my computer here > . > It turns out this registry entry was causing my problem: > > HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat > \UserChoice > Progid REG_SZ (Applications\cmd.exe) > > Deleting the \UserChoice key restored my context menu and ability to > run a ".bat" directly instead of using %COMSPEC%. > > I am going to un-install an re-install postgres to verify that this > solves my installation issues. > > Eric > > > > > > > > On 1/27/2012 12:41 PM, Eric Borts wrote: >> Regarding my final point: >> >> "Similarly, you may prefer to have the default action for a batch >> file (.bat) changed to Edit instead of Open. Double-clicking the file >> will not run the commands in the file, and if users want to run the >> file, they can use the*Open*command on the shortcut menu." >> http://support.microsoft.com/kb/320036 >> >> This advice would be likely to hang the PostgreSQL installer. >> >> Cheers, >> Eric >> >> >> On 1/27/2012 12:32 PM, Eric Borts wrote: >>> Hi Dave and Dharmendra, >>> >>> It is not the "%COMSPEC% /c" call that causes the window to popup, >>> but the WindowStyle parameter to WShell.Run (see Table 3.9 in MS >>> TechNet WSH Objects / Running Programs >>> ). Setting >>> WindowStyle to "0" creates a hidden window. This is how the code in >>> the installer is currently written. Setting it to "1" creates a >>> visible window. This happens when using "%COMSPEC% /c" or when >>> calling the batch file directly. >>> >>> Here is a another site recommending >>> >>> the use of "%COMSPEC% /c" with a "0" second parameter, along with a >>> note about the window (in)visibility: >>> >>> "[...] do not run any command that raises a prompt, dialog, >>> msgbox or any other GUI. This [...] could hang your entire system >>> (since the invisible GUI will be waiting for a reply [...]" >>> >>> Test code is attached that demonstrates using COMSPEC with a "0" >>> versus a "1". >>> >>> Output from SET command is also attached. Note that I've verified >>> that this problem still occurs in Safe Mode. >>> >>> Any other suggestions? I've also posted to StackOverflow >>> >>> for adivce. >>> >>> A separate line of reasoning for using COMSPEC is that the calling >>> of the .bat directly assumes that default action is to execute the >>> batch file. If a user has modified their default .bat actions (which >>> I have not), the postgres installer will fail. Using COMSPEC will >>> avoid that pitfall. >>> >>> I'll keep you posted if I discover why my machine doesn't execute >>> batch files by default, or how it ended up in this condition. The >>> computer is only about 2 months old, so I haven't had *that* much >>> time to overwhelm it with installs. >>> >>> Eric >> > --------------070100060707040300010009 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The installation now runs successfully after deleting that registry key.

In addition, I tried changing the default action on batch files from "Open" to "Edit" using the registry (Windows 7). Double-clicking a file opens it in Notepad, but the installation runs successfully. So it looks like the UserChoice registry key, however it got there, is the essence of the problem.

Which, of course, %COMSPEC% /c would avoid because the program handling batch files is explicit.

Thanks,
Eric

On 1/27/2012 1:16 PM, Eric Borts wrote:
I found the problem with my computer here. It turns out this registry entry was causing my problem:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
    \UserChoice
        Progid REG_SZ (Applications\cmd.exe)

Deleting the \UserChoice key restored my context menu and ability to run a ".bat" directly instead of using %COMSPEC%.

I am going to un-install an re-install postgres to verify that this solves my installation issues.

Eric







On 1/27/2012 12:41 PM, Eric Borts wrote:
Regarding my final point:

"Similarly, you may prefer to have the default action for a batch file (.bat) changed to Edit instead of Open. Double-clicking the file will not run the commands in the file, and if users want to run the file, they can use the Open command on the shortcut menu."
http://support.microsoft.com/kb/320036

This advice would be likely to hang the PostgreSQL installer.

Cheers,
Eric


On 1/27/2012 12:32 PM, Eric Borts wrote:
Hi Dave and Dharmendra,

It is not the "%COMSPEC% /c" call that causes the window to popup, but the WindowStyle parameter to WShell.Run (see Table 3.9 in MS TechNet WSH Objects / Running Programs). Setting WindowStyle to "0" creates a hidden window. This is how the code in the installer is currently written. Setting it to "1" creates a visible window. This happens when using "%COMSPEC% /c" or when calling the batch file directly.

Here is a another site recommending the use of "%COMSPEC% /c" with a "0" second parameter, along with a note about the window (in)visibility:

    "[...] do not run any command that raises a prompt, dialog, msgbox or any other GUI. This [...] could hang your entire system (since the invisible GUI will be waiting for a reply [...]"

Test code is attached that demonstrates using COMSPEC with a "0" versus a "1".

Output from SET command is also attached. Note that I've verified that this problem still occurs in Safe Mode.

Any other suggestions? I've also posted to StackOverflow for adivce.

A separate line of reasoning for using COMSPEC is that the calling of the .bat directly assumes that default action is to execute the batch file. If a user has modified their default .bat actions (which I have not), the postgres installer will fail. Using COMSPEC will avoid that pitfall.

I'll keep you posted if I discover why my machine doesn't execute batch files by default, or how it ended up in this condition. The computer is only about 2 months old, so I haven't had *that* much time to overwhelm it with installs.

Eric



--------------070100060707040300010009--