Electron Auto-Update - Ignore servoy.json config?

Forum to discuss the new web client version of Servoy.

Electron Auto-Update - Ignore servoy.json config?

Postby vik.lamp.vl » Tue Mar 12, 2024 12:58 pm

Hey Guys,

maybe you can help me or have a idea for this topic.

Situation:
Our Clients are running their own tomcat-server on their customer-server. For the Clients were using NGDesktop.
So for it to work correctly, we´re configuring the
Code: Select all
servoy.json
on the client-computer. For example
Code: Select all
C:\Program Files\OurSolution\resources\app.asar.unpacked\config\servoy.json
.

We´re replacing the url properties from
Code: Select all
"url":"http://localhost:8183/OurSolution/solution/OurSolution/index.html"
to
Code: Select all
"url":"http://CUSTOMER-SERVER-IPt:8183/OurSolution/solution/OurSolution/index.html"
.
Because in our war-export we´re setting URL = localhost, every customer has a different server-ip. A very few are server=client, there we dont need to configure the servoy.json.

Now the problem: we got the electron auto-update working fine, its udpating the libraries, executables, etc. BUT it also replaces the servoy.json with the not-configured one.

So the customer gets a "hey you have a electron" update, restarts the application -> update gets downloade -> starts the application -> white-screen because the URL in the config is wrong.

I tried to look further into it, it seems like the electron-builder has a "ignore"-flag for files/directories. But we dont have the electron-builder.

Maybe im not seeing a critical point in this. The next option is to write a own Updater with C#. But maybe you guys have better ideas. Maybe it can even be a feature-request for servoy?

Greetings
-Vik
vik.lamp.vl
 
Posts: 25
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Re: Electron Auto-Update - Ignore servoy.json config?

Postby robert.edelmann » Tue Mar 12, 2024 1:20 pm

Just a thought: If you modify the servoy.json manually, wouldn't it be simpler to add an entry in the local host-file/the systemwide dns to resolve the address from the servoy.json for like "servoy-server.<yourhost>" pointing to the correct ip?

This would have the same effect and would be safe from the updates.
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 95
Joined: Wed Aug 14, 2013 6:12 pm

Re: Electron Auto-Update - Ignore servoy.json config?

Postby mboegem » Tue Mar 12, 2024 1:40 pm

Hi Vik,

Great to read you got this working and definitely interested in the way you achieved this.
I also had my doubts about whether or not the update process would leave alone the JSON configuration file, which you now confirmed.

I like Robert's idea/solution on this, however this is not possible in an environment that is running multiple application servers using NGDesktop.
Still think this is something that should be resolved in the update process, currently it's just a lot of work moving from 1 version to the other as the NGDesktop update needs to be manually updated.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Electron Auto-Update - Ignore servoy.json config?

Postby vik.lamp.vl » Tue Mar 12, 2024 2:42 pm

Hi Guys,

thanks for your input :)

I´ll try @robert.edelmann idea. It should work in theorie, but i dont like the aspect of changing the hosts.file just for our application to update correctly.
Its a bit "hackery" if you know what i mean.
I´ll report if it worked that way.

@mboegem If you need any tipps or infos on how we did it, you can always contact me, im glad to help out in situations like this :)

Anynway, im gonna open a feature-request for servoy. Maybe they can implement the "ignore"-flag in the ngdesktop-exporter. This would be the best-case scenario.

**edit** I put in a feature-request, you can find it under https://support.servoy.com/browse/SVY-19043
I´ll keep this thread upated if i have a solution or any news on this.
vik.lamp.vl
 
Posts: 25
Joined: Wed May 26, 2021 3:37 pm
Location: Germany


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 17 guests

cron