Electron builder - define appId for MSI installer - electron

I'm facing this issue when using electron builder to create EXE and MSI installer. These 2 installers will install 2 different applications to my pc, as I can see 2 identical app showing in Control Panel>Uninstall, the exe has version like 1.0.0 and msi has version 1.0.0.0
Look further to the registry, I see they created 2 keys GUID under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
The key for exe path probably is the hash of appId while I don't know what would be the key for msi.
What I want to achieve is they would end up in the same key, or in other words, when I install the exe version first then install msi version, it should overwrite the existing installed version (from previously exe install).
Hence this questions:
Is it possible to define appId when build with target msi?
Maybe I'm looking for a workaround or trick since they have written this in the doc, but who knows, just some hope I guess:
appId = com.electron.${name} String | “undefined” - The application id. Used as CFBundleIdentifier for MacOS and as Application User Model ID for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.

Related

TEdgeBrowser Canary requirement

I tested TEdgeBrowser in RAD Studio 10.4.2 Sydney. Dropping the component onto a Form in C++Builder and then calling:
EdgeBrowser1->Navigate("https://www.stackoverflow.com/");
This results in an error on my development machine:
Failed to find an installed WebView2 runtime or non-stable Microsoft Edge installation.
I have placed WebView2Loader.dll (from C:\Program Files (x86)\Embarcadero\Studio\21.0\Redist\win32\) into the project's executable folder, so that could not have been the cause of the error.
After that, I installed Edge Canary, and then it started working without errors.
However, if I compile the same project in Release configuration, and then run on another system which only has a stable installation of the Microsoft Edge browser and doesn't have Edge Canary installed, it all works.
But, if I run the same Release build on my build system, it fails to load (probably because of the same reason as the Debug build - it can't find the Canary installation).
I tested TMS's TAdvWebBrowser component, which doesn't have this requirement, and it works on both systems without installing Edge Canary. But I'd prefer to use TEdgeBrowser instead, to avoid an unnecessary dependency on a third party component.
What is the reason for this odd behavior for TEdgeBrowser, and does the same happen in RAD Studio 11 Alexandria? Can this be avoided so it works with a stable Edge installation on both systems?
EDIT: I later discovered that there is this property:
EdgeBrowser1->BrowserExecutableFolder = "C:\\Program Files (x86)\\Microsoft\\EdgeCore\\101.0.1210.53";
With that, all works. But, according to the documentation (Using TEdgeBrowser Component and Changes to the TWebBrowser Component), it should automatically locate the current version of the WebView2 control on the system. It does this on one system, but not on the development system.
TEdgeBrowser requires WebView2 Runtime in order to operate. More details on MS Edge Documentation website.
WebView2Loader.dll should be loadable by your application, in the same folder, known path or registered in path environment variable. Latest version is available on NuGet. Nupkg is a zip archive. Look in build\native\ folder.
TEdgeBrowser.BrowserExecutableFolder should point to WebView2 runtime folder in case of fixed version.
Fixed version distribution, placed inside your application folder seems the preferred way on your scenario.
MS claims that evergreen version will be distributed by default in next Windows versions.

Delphi, WebView2/TEdgeBrowser and the fixed runtime

I have been working with TEdgeBrowser/WebView2 and an installed version of the Edge Beta/Canary browser version as the "runtime" which seems to work fine. However for production rollout we would greatly prefer to ship the fixed version of the runtime from within our application directory.
I have been attempting to use the following:
MyEdgeBrowser.BrowserExecutableFolder := ExtractFileDir(Application.ExeName) + '\WebView2Runtime';
Within the above referenced path I have the msedgewebview2.exe with the full installation of the fixed version runtime and all supporting files & folders. This is the file that I downloaded and extracted:
Microsoft.WebView2.FixedVersionRuntime.98.0.1108.62.x86.cab
Here's an image of what it looks like when extracted:
I have attempted to place the WebView2Loader.dll in my app directory, in the WebView2Runtime folder, and even in the WebView2Runtime\win-x86\native folder, always as a subfolder of my application directory.
I've tried the 11/20/2021 version of WebView2Loader.dll that Embarcadero distributes with the GetIt package manager, as well as the latest and greatest versions distributed by Microsoft via the NuGet package manager.
The CreateWebView call always fails.
Has anyone successfully got the fixed version runtime to work with Delphi & the WebView2Loader.dll? Are there version specific issues? What folder structure is required?
Thanks.
UPDATE: One crappy workaround that I found was to install a dev or canary version of Edge, then copy all of the files from the "C:\Program Files(x86)\Microsoft\Edge Beta" folder into my app folder, uninstall Edge Beta/Canary, then point the BrowserExecutableFolder to the "Edge Beta\Application<version #>" folder. This is the first time I've seen a "fixed version runtime" function without an Edge or Canary install.
I had started the project in 64-bit mode but for internal reasons had to switch to 32-bit mode. Unfortunately I had not switched back to the 32-bit version of WebView2Loader.dll, but was using the 32-bit version of the runtime.
Once I switched to the 32-bit version of WebView2Loader.dll the TEdgeBrowser was able to work with just the fixed version runtime, no further installation required.

Failed to initialise Edge browser control

Having a hard time attempting to run an example how to use TEdgeBrowser component on Windows 10.
Using the latest RAD Studio 10.4.1 (27.0.38860.1461)
The example is located under this path:
c:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\VCL\WebBrowser\Edge\
Attempting to start results in "Failed to initialise Edge browser control".
What I tried:
Installed the latest stable Edge version (88.0.705.68 (Official build) (64-bit))
Downloaded and installed the runtime from
https://developer.microsoft.com/en-us/microsoft-edge/webview2/
Downloaded this:
https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.705.50
Extracted WebView2Loader.dll and placed into the same folder where the compiled executable of the above demo resides
The documentation on:
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TEdgeBrowser_Component_and_Changes_to_the_TWebBrowser_Component
Seems to be out of date and refers to old 0.9.430 version. I have actually previously used Edge Canary release with that version of WebView2Loader.dll before and that has worked, but the stable version of Edge Chromium was released in the meanwhile, assuming there were breaking API changes.
So, is it even possible to use TEdgeBrowser with Edge Chromium at this point because from all that I've tried it seems pretty hopeless? To me it looks like it is hard-coded against 0.9.430 and RAD Studio 10.4.1 wasn't updated. Is there a workaround of any sort?
for solving this copy "WebView2Loader.dll" to your output path
TEdgeBrowser requires WebView2 Runtime in order to operate. More details on MS Edge Documentation website.
WebView2Loader.dll should be loadable by your application, in the same folder, known path or registered in path environement variable. Latest version is available on NuGet. Nupkg is a zip archive. Look in build\native\ folder.
TEdgeBrowser.BrowserExecutableFolder should point to WebView2 runtime folder in case of fixed version.
MS claims that evergreen version will be distributed by default in next Windows versions.

Correct name format for Bundle subfolders in ZIP file?

i'm new in BB development.
I need to make a ZIP file for the release of the app on vendor portal. I'm reading this: https://developer.blackberry.com/devzone/appworld/preparing_your_zip_file.html#pde1350481571678
I have problems to understand name format for Bundle subfolders in ZIP file...
The name of the bundle subfolder specifies the earliest version of the
operating system that the bundle supports. The name must use the
following format: bundle_name_x.x.x.x, where x.x.x.x represents the
version of the BlackBerry Device Software or BlackBerry PlayBook OS.
My app must target BlackBerry PlayBook OS 2.0 (or later). So what i should put as name of the subfolder?? BlackBerry_PlayBook_OS_2.0.0.0 ???
Thanks
Correct, use BlackBerry_PlayBook_OS_2.0.0.0 to target PlayBook OS 2.0 or later.
The reason for this format, is so you as the vendor have amazing control over which platforms you target. Say there is an OS bug affecting your app that is occurring in PlayBook OS 2.0.0.1.
If you wanted to ensure that only users with supported OS' can download your app, you could create a folder named BlackBerry_PlayBook_OS_2.0.0.2

Where to download the latest version of Entity Framework?

I am using EF 4.0, at the time I am writing these lines I heard that EF 4.1 update 1 has been released and EF 4.2 is in beta. From wikipedia
A refresh of version 4.1 named Entity Framework 4.1 Update 1, was
released on July 25, 2011. It includes bug fixes and new supported
types.
But I only found a link of Version 4.1.10311.0 from Microsoft which date published is 3/21/2011. So I wonder if version 4.1.10311.0 is the latest release so far. If it's not, where can I download the latest release ?
ps : For some reasons I can't use live update, I need to download package to install manually.
From Arthur Vickers:
What if I can’t use NuGet? What if you can’t connect to the Internet
from your development machine. Or what if you are not allowed to
install NuGet on your machine. Don’t worry; all is not lost.
First you need to get the NuGet package. For this you do need to be
able to connect to the Internet from some machine—but it doesn’t have
to be your development machine. You’re reading this so presumably
you’re not completely off-the-grid. :-)
You can get the package by using NuGet in Visual Studio on a machine
connected to the Internet in the normal way—just install the package
you want into a dummy project. After installing the package you can
find the .nupkg file either in the dummy project folder or by browsing
the Package Cache from the Package Manager Settings menu option.
You can also get the package without Visual Studio by using NuGet.exe.
If you are able to install NuGet on your development machine then do
so and setup a local feed. This may sound daunting but it’s really
easy. Copy the .nupkg file to your local feed and then use NuGet to
install it in the normal way—with no connection to the Internet
required.
If you can’t install NuGet on your development machine then take the
.nupkg file and rename it to .zip—yep, it’s a zip file. You can now
extract EntityFramework.dll from the zip file and use it as you would
any other assembly. Note that you will not get any of the automatic
project-level integration I mentioned above, so you may have to do
more manual configuration of your project.
If you are using EFv4.0 you mostly don't need EFv4.1 or EFv4.2. Those versions bring new type of mapping (code first / fluent) and new DbContext API which can be used instead of ObjectContext API. So unless you want to start a new project with those "new" features or completely migrate your existing project you don't need it. Real new functionality for you will be included in .NET 4.5. DbContext API and code first is shipped only as NuGet package since EFv4.2.
use the package-manager in VS2010 to install
Tools + Library Package Manager + Nuget package manager
EF 4.2 has just been released: http://blogs.msdn.com/b/adonet/archive/2011/11/01/ef-4-2-released.aspx
This is a minor update over 4.1.
The runtime components are available via NuGet. The designer etc. updates for VS are a separate install.

Resources