Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIhnV-00G0NO-3C for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 05:19:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIhnS-00F4RY-2n for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 05:19:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIhnR-00F4RQ-Ho for pgadmin-hackers@lists.postgresql.org; Wed, 04 Dec 2024 05:19:35 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIhnO-000wsh-Hm for pgadmin-hackers@postgresql.org; Wed, 04 Dec 2024 05:19:32 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5f25c47d22aso288110eaf.1 for ; Tue, 03 Dec 2024 21:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1733289570; x=1733894370; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XTja56zFISyw6iNo3RB4y4rgpgcIH9r1IrIcsKxT158=; b=huQKOj8HvX5Ce+lwroixkIyA7x20FXzR3IqPjkOkk4IVr/8pLH7p+xzWFjaUqWX5pF mtGqOUzTs4x9AjQvPjyMYgpy33BZAv/6c6tFjNfibpJyKHFFi/4u+yEy3j3R9ndAXbt5 Wjppm3/l1m8BEz6W6bq9NKEPutINisoAkcRLMEXiXc+ltz5YGd0fM3DL+nnZgujsjtgx EaM2loLyjExKxkIXmVqOh/nGQ3Q8BJz2gxpVGbzaZguTvf17g+U5wPmmHs9zkVRwaq+i ZsiDgOrWknfDbmMXB5WZZhPNu9XNSlyKRuLV9NxxnLZe4KuDreJnmYYsV6d9ZnC40gkt 2XAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733289570; x=1733894370; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XTja56zFISyw6iNo3RB4y4rgpgcIH9r1IrIcsKxT158=; b=aAB0GPkQ1ySNC/rGtC6PoqgqkJJbZC5sGkQyp6Jra2hkt6Pyvxt9FuOPvHQVxyVdP6 giVi1slxZ3vDzdMi/rF0q+qYquHBjcea7rAzkgRRUsXxaNR8xrvVkf0nOmBWMFPNoGyN GtVpWQP08jXPXA6rNFssxNW3YO05aCSUrdv4HMpEUDpZQdPk6YbBPsNKHuoiHUFqbg0L G7g7wPNa+RCrAOi/J/3OBGLNSqN1sDtyaqBNdo15wQ3vFJxthG0UlnIpElehZcgJ2kZS cVsoTqc5mk/cl5FPPZznzx9vlYXtEXKm1Yp1bylVcNZNx1gN6gXl+aCbUB0EqJygo/eq tiXQ== X-Gm-Message-State: AOJu0YyL2z7yXGRTIigkk+1ibn1FGFMMrd9UmvOnhqlRKeHNqgKVNC7c CqIBYd51mcWwdbKgeL94JXP5chqb+O1yc4IxQ6j17kCP0n5xEg0RMkpuY7BRHsKQEB7u1e/kS/q 22j+5IXOpbJi87XwVx1HXvQcM5IfjZpK4AnClenY7A9eVF5Q= X-Gm-Gg: ASbGncuMGCxDuZ07sDilN0q/67CYaGuWfGHFid+VYObqKMf+Nd2U/3vohcPM5aPBIun 093DC3wZrsM85jIBoH4Ut3MEMNxnOx76gWvrQXKajRl66pBB6+lYHOfaMRIvArpXz X-Google-Smtp-Source: AGHT+IGFfVL4KmMUiCXM/VE+OgPPkvlDXCsGQedZRjvTUeTw40y54tDOLtjP2PJCEAD2bTPrgJhIiRVbi31KqY+S4Dg= X-Received: by 2002:a05:6820:1f07:b0:5eb:c72e:e29f with SMTP id 006d021491bc7-5f25ae1ae0amr3714697eaf.1.1733289569570; Tue, 03 Dec 2024 21:19:29 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Anil Sahoo Date: Wed, 4 Dec 2024 10:48:53 +0530 Message-ID: Subject: Re: Require suggestions on feature #5766 To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000001662dd06286aed19" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001662dd06286aed19 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dave, For Windows, I checked how pgAdmin works for machine-wide installations as admin1 (Administrator), and there is another admin user like admin2 (Administrator), and normal users are user1 and user2. When logged in as other mentioned users, I was able to use pgAdmin, but when I tried to upgrade pgAdmin as admin2 from v8.12 to v8.13, I faced the below error: "An error occurred while trying to replace the existing file: DeleteFile failed; code 5. Access is denied." And if I cancel installation, then run pgAdmin, v8.12 is getting corrupted and giving "The pgAdmin 4 server could not be contacted: C:\Program Files (x86)\pgAdmin 4\python\python.exe: can't open file =E2=80= =98 C:\\ Program Files (x86)\\pgAdmin 4\\web\\pgAdmin4.py: [Errno 2] No such file or directory." For user-level installation, everything is working fine for different users= . I have checked some of the desktop applications that are being built with Electron, like VS Code and Postman. *How VS Code works is,* They have 2 different installers, one for user level and another for system level. When I installed the VS Code system installer on admin1, it was working fine, and I was able to check for updates, and for admin2 and user1, it is available, working fine and able to check for updates, not able to update as I am in the latest version. (Note: not found system installers for older versions, but user installers are available) When I installed the VS Code user installer on admin1, it was working fine, and VS Code says when running it as an administrator in a user setup installation, updates will be disabled. When I tried to install the user installer on user1, it was working fine and able to check for updates. *How Postman works is,* When I installed Postman on admin1, it was available for admin2 also. It was working fine, and checking for auto updates was also working fine for both admins. It is not available for normal users when installed for admins= . When I installed Postman for user1, it was available only for the current user, and checking for updates was working fine. So please give your suggestions on which approach to follow. Thanks, Anil On Fri, Nov 29, 2024 at 7:15=E2=80=AFPM Dave Page wrote= : > Hi > > On Thu, 28 Nov 2024 at 11:38, Anil Sahoo > wrote: > >> Hi Dave, >> >> I have mentioned the requirements for the deployment server to add >> auto-update in macOs systems. >> >> >> The frontend will request deployment server with Accept: application/jso= n >> and the current version of pgAdmin and the architecture of macOs system = and >> server will check if any update is available or not, if update available >> then server responds with status code 200 OK and sends the below format >> JSON response in the body. >> >> >> Example of deployment url: >> https://your-deployment-url.com/update/darwin/8.12 >> >> >> Example of response: >> >> { >> "url": "https://your-deployment-url.com/your-app-8.13-darwin.zip", >> "name": "8.13", >> "notes": "Theses are some release notes innit", >> "pub_date": "2024-09-18T12:29:53+01:00" >> } >> >> >> Here url is mandatory and others are optional. >> >> Squirrel will request "url" with Accept: application/zip and only >> supports installing ZIP updates. >> >> "pub_date" if present must be formatted according to ISO 8601. >> >> >> If no update is required, the server must respond with a status code >> of 204 No Content. >> > > Ah, OK - so it's just the metadata. We can handle that pretty easily in > the pgaweb code. > > >> >> >> And for Windows systems, Electron recommended to use electron-winstaller >> or electron forge as using these packages will use Squirrel.Windows for >> creating windows installer and that will help in triggering custom launc= h >> events and that can be handled by our application for proper setup. But >> what I think is, as we are using Inno setup for creating our Windows >> installer, we can try updating our application with existing way only, i= f >> something does not work then we have the option to change our installer >> creation process. >> > > So one thing that springs to mind is that on Windows, this is only likely > to work with per-user installations, however, generally the default is fo= r > machine-wide installations. Have you given that any thought? > > >> >> Thanks, >> >> Anil >> >> On Wed, Nov 27, 2024 at 10:34=E2=80=AFPM Dave Page w= rote: >> >>> Hi! >>> >>> On Wed, 27 Nov 2024 at 07:58, Anil Sahoo >>> wrote: >>> >>>> Hi Dave/Team, >>>> >>>> I am currently working on the auto-update feature of pgAdmin 4 desktop >>>> application, #5766 >>>> . >>>> >>>> >>>> As we are using Electron for shipping our desktop application, I have >>>> gone through some possible ways we can implement the auto update of th= e >>>> app. >>>> >>>> I found 2 most popular ways, that are >>>> >>>> 1. *Use builtin electron=E2=80=99s autoUpdater* (Uses the Squirrel >>>> framework & Available for Mac, Windows) >>>> 2. *Use electron-builder and electron-updater packages *(Available >>>> for Mac, Windows and Linux systems) >>>> >>>> *Linux systems:* >>>> >>>> >>>> - Builtin Electron=E2=80=99s autoUpdater support is not available. >>>> - electron-builder and electron-updater can be used, but need to >>>> change the whole build process. Also most apps like VS code, Chrome= , etc >>>> does not support auto-update of apps on linux systems. >>>> >>>> We should not try to auto-update on Linux, because we're using the >>> platform native packaging and auto-updating will cause nasty problems w= ith >>> that. >>> >>> >>>> *Mac systems:* >>>> >>>> - We can use the builtin Electron=E2=80=99s autoUpdater to add auto= -update >>>> feature to macOs systems, It is simple and easy to configure. We ne= ed a >>>> minor modification in our build process i.e. as we are supporting I= ntel and >>>> Apple silicon chips, deployment url will have 2 zip files and each = zip file >>>> will hold the build for arm64 and x86_64. >>>> - electron-builder and electron-updater can be used. With this, we >>>> have to change the whole build process. >>>> >>>> *Windows systems:* >>>> >>>> - We can use the builtin Electron=E2=80=99s autoUpdater to add auto= -update >>>> feature to windows systems, Here also we need to change our build p= rocess. >>>> Electron=E2=80=99s docs recommend using electron-winstaller or elec= tron forge to >>>> create the installer and some extra changes are needed in the deplo= yment >>>> server. >>>> - electron-builder and electron-updater can be used. With this, we >>>> have to change the whole build process. >>>> >>>> As Electron's builtin autoUpdater is easy to use so for now we can mov= e >>>> with the auto-update of the pgAdmin app on macOs systems as it require= s >>>> minimal changes. >>>> >>> >>> That certainly sounds like the better option. A couple of questions: >>> >>> - What changes are required in the deployment server? We are very >>> limited here, as we deploy through the postgresql.org infrastructure. >>> >>> - Whilst the docs (for Windows) recommend using electron-winstaller or >>> electron forge, can you confirm one of them *must* be used? Our current >>> installer is pretty standard in the way it works, so I'm curious to kno= w if >>> we would actually need to change technology for a specific reason. >>> >>> Thanks! >>> >>> -- >>> Dave Page >>> pgAdmin: https://www.pgadmin.org >>> PostgreSQL: https://www.postgresql.org >>> pgEdge: https://www.pgedge.com >>> >>> >> >> -- >> >> >> *Anil Sahoo* >> >> Software Development Engineer II >> >> LinkedIn || Blog >> || *GitHub >> * >> >> enterprisedb.com >> > > > -- > Dave Page > pgAdmin: https://www.pgadmin.org > PostgreSQL: https://www.postgresql.org > pgEdge: https://www.pgedge.com > > --=20 *Anil Sahoo* Software Development Engineer II LinkedIn || Blog || *GitHub * enterprisedb.com --0000000000001662dd06286aed19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi Dave,

For Windows, I checked how pgAdmin works for machine-wide installations = as admin1 (Administrator), and there is another admin user like admin2 (Adm= inistrator), and normal users are user1 and user2. When logged in as other = mentioned users, I was able to use pgAdmin, but when I tried to upgrade pgA= dmin as admin2 from v8.12 to v8.13, I faced the below error:

"An error occurred while trying to replace the existing file:

DeleteFile failed; code 5.

Access is denied."

=C2=A0And if I cancel installation, then run pgAdmin, v8.12 is getting c= orrupted and giving

"The pgAdmin 4 server could not be contacted:
C:\Program Files (= x86)\pgAdmin 4\python\python.exe: can't open file =E2=80=98 C:\\ Progra= m Files (x86)\\pgAdmin

4\\web\\pgAdmin4.py: [Errno 2] No such file or directory."

Fo= r user-level installation, everything is working fine for different users.<= /p>

I have checked some of the desktop applications that are being built wit= h Electron, like VS Code and Postman.

How VS Code works is,

They have 2 different installers, one for user level and another for sys= tem level.

When I installed the VS Code system installer on admin1, it was working = fine, and I was able to check for updates, and for admin2 and user1, it is = available, working fine and able to check for updates, not able to update a= s I am in the latest version. (Note: not found system installers for older = versions, but user installers are available)

When I installed the VS Code user installer on admin1, it was working fi= ne, and VS Code says when running it as an administrator in a user setup in= stallation, updates will be disabled.

When I tried to install the user installer on user1, it was working fine= and able to check for updates.

How Postman works is,

When I installed Postman on admin1, it was available for admin2 also. It= was working fine, and checking for auto updates was also working fine for = both admins. It is not available for normal users when installed for admins= .

When I installed Postman for user1, it was available only for the curren= t user, and checking for updates was working fine.

So please give your suggestions on which approach to follow.


<= /p>

Thanks,

Anil


On Fri, Nov 29, 2024 at 7:15=E2=80=AFPM Dave = Page <dpage@pgadm= in.org> wrote:
Hi

On Thu, 28 Nov 2024 at 11:38, Anil Sahoo <= anil.sahoo= @enterprisedb.com> wrote:
Hi Dave,

I have mentioned the req= uirements for the deployment server to add auto-update in macOs systems.


The frontend will reques= t deployment server with Accept: application/json and the current version o= f pgAdmin and the architecture=C2=A0of macOs system and server will check i= f any update is available or not, if update available then server responds = with status code 200 OK=C2=A0 and sends the below format JSON = response in the body.


Example of depl= oyment url: https://your-deployment-url.com/update/darwin/8.12


=

Example = of response:

{
=C2=A0 =C2=A0 "= ;url": "https://your-deployment-url.com/your-app-8.13= -darwin.zip",
=C2=A0 =C2=A0 "name": "8.13",=
=C2=A0 =C2=A0 "notes": "Theses are some release notes in= nit",
=C2=A0 =C2=A0 "pub_date": "2024-09-18T12:29:53= +01:00"
}


Here url is mandatory an= d others are optional.

Squirrel will request &q= uot;url" with=C2=A0Accept: application/zip=C2=A0and only supports inst= alling ZIP updates.

"pub_date" if = present must be formatted according to ISO 8601.


If no update is required= , the server must respond with a status code of=C2=A0204 No Content.


Ah, OK - so it's just the met= adata. We can handle that pretty easily in the pgaweb code.
=C2= =A0



And for Windows systems,= Electron recommended to use electron-winstaller or electron forge as using= these packages will use Squirrel.Windows for creating windows installer an= d that will help in triggering custom launch events and that can be handled= by our application for proper setup. But what I think is, as we are using = Inno setup for creating our Windows installer, we can try updating our appl= ication with existing way only, if something does not work then we have the= option to change our installer creation process.


So one thing that springs to mind is that on Windows= , this is only likely to work with per-user installations, however, general= ly the default is for machine-wide installations. Have you given that any t= hought?
=C2=A0


Thanks,

Anil


On Wed, Nov = 27, 2024 at 10:34=E2=80=AFPM Dave Page <dpage@pgadmin.org> wrote:
Hi!

=
On Wed, 27= Nov 2024 at 07:58, Anil Sahoo <anil.sahoo@enterprisedb.com> wrote:

Hi Dave/Team,

I am currently working on the auto-up= date feature of pgAdmin 4 desktop application, #5766.


As we are using Electron= for shipping our desktop application, I have gone through some possible wa= ys we can implement the auto update of the app.

I found 2 most popular ways, that are

  1. Use builtin electron= =E2=80=99s autoUpdater (Uses the Squirrel framework & Available for= Mac, Windows)
  2. Use electron-builder= and electron-updater packages=C2=A0(Available for Mac, Windows and Lin= ux systems)

Linux systems:

  • Builtin Elec= tron=E2=80=99s autoUpdater support is not available.
  • electron-build= er and electron-updater can be used, but need to change the whole build pro= cess. Also most apps like VS code, Chrome, etc does not support auto-update= of apps on linux systems.=C2=A0
We should not try to auto-update on Linux, because we'r= e using the platform native packaging and auto-updating will cause nasty pr= oblems with that.
=C2=A0

Mac systems:

<= ul>
  • We can use the builtin Electron=E2=80=99s autoUpdater to add auto-update= feature to macOs systems, It is simple and easy to configure. We need a mi= nor modification in our build process i.e. as we are supporting Intel and A= pple silicon chips, deployment url will have 2 zip files and each zip file = will hold the build for arm64 and x86_64.
  • electron-builder a= nd electron-updater can be used. With this, we have to change the whole bui= ld process.=C2=A0
  • Windows systems:<= /p>

    • We can use the builtin Electron=E2=80=99s autoUpdater to add auto-up= date feature to windows systems, Here also we need to change our build proc= ess. Electron=E2=80=99s docs recommend using electron-winstaller or electro= n forge to create the installer and some extra changes are needed in the de= ployment server.
    • electron-builder and electron-updater can b= e used. With this, we have to change the whole build process.=C2=A0

    As Electron's builti= n autoUpdater is easy to use so for now we can move with the auto-update of= the pgAdmin app on macOs systems as it requires minimal changes.

    =

    That certainly sounds like the= better option. A couple of questions:

    - What chan= ges are required in the deployment server? We are very limited here, as we = deploy through the post= gresql.org infrastructure.

    - Whilst the docs (= for Windows) recommend using electron-winstaller or electron forge, can you= confirm one of them *must* be used? Our current installer is pretty standa= rd in the way it works, so I'm curious to know if we would actually nee= d to change technology for a specific reason.

    Than= ks!
    =C2=A0
    -- <= /span>


    --


    Anil Sahoo=

    Software Develop= ment Engineer II

    LinkedIn=C2=A0|| Blog= =C2=A0|| GitHub


    enterprisedb.com

    <= /span>


    --


    --


    =

    Anil Sahoo

    = Software Developmen= t Engineer II

    LinkedIn=C2=A0|| Blog=C2= =A0|| GitHub


    enterprisedb.com

    --0000000000001662dd06286aed19--