Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ezMhj-0005Rk-Fq for pgadmin-hackers@arkaria.postgresql.org; Fri, 23 Mar 2018 13:25:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ezMhi-00068u-5j for pgadmin-hackers@arkaria.postgresql.org; Fri, 23 Mar 2018 13:25:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ezMhh-0005xn-He for pgadmin-hackers@lists.postgresql.org; Fri, 23 Mar 2018 13:25:58 +0000 Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ezMhd-0003te-S0 for pgadmin-hackers@postgresql.org; Fri, 23 Mar 2018 13:25:55 +0000 Received: by mail-qt0-x22b.google.com with SMTP id g5so1352688qth.7 for ; Fri, 23 Mar 2018 06:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+0nLaHEyEyp9iQNtJpdnqUGJd/6lDU6dCpy8hRySAVc=; b=Q7cyUYP7fcoFTJuraSXmUp8s6smtZJhCJOKf8uDUBLqYh9UXJyWjMz+pSrZPjjzCiW EkT2DmYwn+XcXol2fAPU45jwMNNcP8gLEHuZzJVatHvCjWTtmVzbz5ErOc+0WQwXa60D F+B4wbCB7JuMc5SlE4fcsCNpxjfJNoXbQ8Um/FObJBimTKLzOHdd3oqJpc6Sl2ITU+E1 nG54fLNnHNyHvC6plpv99M2/c4tBd3wGIdGDUiKPppol8i2dAniz5FLm56hbTBYAfuNC KcitdtqyVotq/0dZ+hVXvWsU/9z1oo3vnTtzg0vjfcyhuanfmWOjK14qVKI5Vi984HQc r/XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+0nLaHEyEyp9iQNtJpdnqUGJd/6lDU6dCpy8hRySAVc=; b=Ce8TIQy9P9IPLZX+gHQ9i2nFW6ihXOkGI5bl7UP85Yi0q42Q0SOS0rUhP88H3gQPVR DOWHV5lzO1pN5YK+KFCupX1mJ2wve/yIWpvoutpR3X7BwwXOU8yvyKQFMkq4blRgKP4A F3wN6x1T/egtgjPTF8ZR4JJ1+T9DS8Nl3QKQ8z3ahDEwcz7FOQVqjRH5vNglmLNx8GP/ eYQ/3pedYq5Pbtmu74JD3HHC3K/aNCDuwRDqnXFMQPslbVL/Phwv44XWcMX0VYQRY4vo U703Qo3UJjmlbjXLU1jiuwntEzPOI1mrPTpPT+bBHM29G2b+YMsd8DbzNYz0oJwN5ASe RXYA== X-Gm-Message-State: AElRT7HSUeAoq8cGO43VXlfyXsUiS0v7J5mSJG/x4H+EY+fm3RItmBQR lYv2OkC6cOA9+Ks34X2dz661agS4mWq9LFzOjai/WQ== X-Google-Smtp-Source: AG47ELt3IQCnhrgZDJZvpz1yuL+A+e8uwtEVI3SDHBbQuEnTu11oc9De2KaCwn7OsqeW6Llu0rS5UqnCR6dOQc+noiQ= X-Received: by 10.200.47.163 with SMTP id l32mr39841027qta.195.1521811552540; Fri, 23 Mar 2018 06:25:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.194.131 with HTTP; Fri, 23 Mar 2018 06:25:51 -0700 (PDT) In-Reply-To: References: From: Akshay Joshi Date: Fri, 23 Mar 2018 18:55:51 +0530 Message-ID: Subject: Re: v3.0 release on hold To: Dave Page Cc: pgadmin-hackers , Murtuza Zabuawala , Khushboo Vashi , Syed Fahar Abbas , =?UTF-8?B?RGV2cmltIEfDnE5Ew5xa?= Content-Type: multipart/alternative; boundary="001a113d802c012f6e0568145d26" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a113d802c012f6e0568145d26 Content-Type: text/plain; charset="UTF-8" Hi Dave On Fri, Mar 23, 2018 at 11:06 AM, Akshay Joshi < akshay.joshi@enterprisedb.com> wrote: > > > On Thu, Mar 22, 2018 at 10:24 PM, Dave Page wrote: > >> Hi >> >> On Thu, Mar 22, 2018 at 1:13 PM, Dave Page wrote: >> >>> >>>>>>> 2) Starting a second instance of the app bundle on Mac doesn't >>>>>>> always open a new pgAdmin window as it should. It works fine in the >>>>>>> debugger, or if you start the app with a command like: >>>>>>> "/Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4". It doesn't >>>>>>> work if you double-click the appbundle or use a command like "open >>>>>>> /Applications/pgAdmin\ 4.app" >>>>>>> >>>>>> >>>>>> Still working on this, not found any solution yet. >>>>>> >>>>> >>>> Not able to figure out the solution yet. I have tried to debug >>>> the code, but every time it will create a new instance(tray icon). Do I >>>> need to look into the code or something related to app bundle may be some >>>> settings in info.plist or any other pointer? >>>> >>> >>> Have a look at the code around line 85 an onwards of pgAdmin4.cpp. It >>> creates the shared memory interlock (and log/address files) based on the >>> current username and a hash of the executable name/path. My suspicion is >>> that the path hash (which is calculated from argv[0] on line 72) is for >>> some reason getting a different value each time when launched via the >>> Finder or "open", thus the interlock is failing. >>> >> >> So I took a look at this, and it seems the code is just fine. What is >> happening is that macOS only allows a single instance of an app to run at >> once. Whilst that is what we want of course, macOS is causing the new >> instance to exit before it has a change to open a new pgAdmin window. Using >> "open -n ..." or calling the embedded executable directly resolves that >> issue. >> >> So, there's another challenge to figure out... :-( >> > > OK. Will try to figure that out. > After googled I have tried following solution: 1. Create a shell script "launch.sh" and kept it in "/Applications/pgAdmin\ 4.app/Contents/MacOS" folder. That shell script will contain the command "open -n /Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4". Change the "CFBundleExecutable" parameter of Info.plist from "pgAdmin4" to "launch.sh". It didn't work, shall script didn't launch. 2. Create one apple script with command like "do shell execute "/Applications/pgAdmin\ 4.app", compile it and save it as Application. It create the app bundle, copy contents of pgAdmin4 app to this newly created application. But the problem is it opens and having icon in the dock and no response on double click (second time). Will continue to figure out some other solutions tomorrow. > >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > > > -- > *Akshay Joshi* > > *Sr. Software Architect * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* > -- *Akshay Joshi* *Sr. Software Architect * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* --001a113d802c012f6e0568145d26 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave

On Fri, Mar 23, 2018 at 11:06 AM, Akshay Joshi <= ;akshay.= joshi@enterprisedb.com> wrote:


On Thu, Mar 22, 2018 at 10:24 PM, Dave Page <dpag= e@pgadmin.org> wrote:
Hi

On Thu, Mar 22, 2018 at 1:13 PM, Dave Page <dpage@pgadmin.org&g= t; wrote:
=

2) St= arting a second instance of the app bundle on Mac doesn't always open a= new pgAdmin window as it should. It works fine in the debugger, or if you = start the app with a command like: "/Applications/pgAdmin\ 4.app/Conte= nts/MacOS/pgAdmin4". It doesn't work if you double-click the = appbundle or use a command like "open /Applications/pgAdmin\ 4.app&quo= t;

=C2=A0 Still working = on this, not found any solution yet.

=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0Not able to figure out the solution yet. I have tri= ed to debug the code, but every time it will create a new instance(tray ico= n). Do I need to look into the code or something related to app bundle may = be some settings in info.plist or any other pointer?=C2=A0

Have a look at the code arou= nd line 85 an onwards of pgAdmin4.cpp. It creates the shared memory interlo= ck (and log/address files) based on the current username and a hash of the = executable name/path. My suspicion is that the path hash (which is calculat= ed from argv[0] on line 72) is for some reason getting a different value ea= ch time when launched via the Finder or "open", thus the interloc= k is failing.

So I took a look at this, and it seems the code is just fine. What is hap= pening is that macOS only allows a single instance of an app to run at once= . Whilst that is what we want of course, macOS is causing the new instance = to exit before it has a change to open a new pgAdmin window. Using "op= en -n ..." or calling the embedded executable directly resolves that i= ssue.

So, there's another challenge to figure = out... :-(=C2=A0

=
=C2=A0 =C2=A0 OK. Will try to figure that out.=C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Afte= r googled I have tried following solution:=C2=A0
  1. Create a= shell script "launch.sh" and kept it in=C2=A0 "/Applications/pgAdmin\ 4.app/Contents/MacOS" folder. Th= at shell script will contain the command "open -n=C2=A0/Applications/pgAdmin\ 4.app/Contents/= MacOS/pgAdmin4". Change the "CFBundleExecutable" para= meter of Info.plist from "pgAdmin4" to "launch.sh".=C2= =A0 It didn't work, shall script didn't launch.
  2. <= li>Create one apple scr= ipt with command like "do shell execute "

    --
    Dave Page
    Blog: http://pgsnake.blogspot.com
    Twitter: @pgsnake=

    EnterpriseDB UK: http://www.enterprisedb.com
    The Enterprise PostgreSQL Compan= y



    <= /div>--
    Akshay Joshi
    Sr. Sof= tware Architect

    Phone: +91 20-3058-9517
    Mobile: +91 976-788-8246
    <= /b>



    --
    Akshay Joshi
    Sr. Software Architect
    =

    <= /font>

    Phone: +91 20-3058-9517
    Mob= ile: +91 976-788-8246
--001a113d802c012f6e0568145d26--