Move to Web to the Desktop or just Both
by Mauricio Rojas, on Nov 10, 2019 5:25:46 PM
My youngest son has a sweet tooth. And every time I asked him to choose a dessert he used to cry. When I asked why he said: because you are making me choose!!!
So, usually, when we modernize legacy applications like VB6, WinForms, Powerbuilder or Delphi... we used to ask: do you want to go to Web or Desktop. But what about both?
So today we'll do that and we will be using Electron.
Electron
Electron is an open-source library developed by GitHub for building cross-platform desktop applications with HTML, CSS, and JavaScript. Electron accomplishes this by combining Chromium and Node.js into a single runtime and apps can be packaged for Mac, Windows, and Linux.
Electron began in 2013 as the framework on which Atom, GitHub's hackable text editor, is built. The two were open-sourced in the Spring of 2014.
It has since become a popular tool used by open source developers, startups, and established companies.
Turning a VB6 Legacy App into a Web and Desktop App
Using the SKS demo we will show how easy it is to do this conversion.
Just follow these steps:
- Create a directory called Electron
- Switch to that directory
- Clone SKS WebMap running
git clone https://github.com/MobilizeNet/SKSWebMap.git
- Clone SKS Electron running
git clone https://github.com/MobilizeNet/SKSElectron.git
- Build binaries for Win64 and OSX. Switch to SKSWebMap and run:
dotnet publish -c Release -r osx-x64
dotnet publish -c Release -r win-x64
-
After compilation you will have two folders under
SKSWebMap\bin\Release\netcoreapp2.2
calledosx-x64
andwin-x64
copy these two folders toSKSElectron\api
-
Go to
SKSElectron
and run npm install -
After installation you can run
electron .
to test your app inside electron or runelectron-builder
to build your binaries for windows and mac
NOTE: On some computers the you need to run the
electron-builder
by runningnode_modules\.bin\electron-builder
And that's all. After that you will have a folder Electron\dist
with an exe that is your installer for a Windows Desktop App. You can run the same on a Mac to build binaries for OSX