The previous released version does not execute properly in Windows machines. This PR implements necessary fixes to allow for an operational Windows installer and executable.
Bug:
On start-up, the Electron BrowserWindow is initialized, rendering the built html, css, and js assets. The filepaths for these assets are passed to our custom awsaml:// protocol handler, which opens and renders the files. On Windows machines, these filepaths will most likely live in the C:/ drive. When the filepath is passed to our protocol handler as a URL - e.g. awsaml://C:/Users/theUser/Downloads/awsaml/build/index.html - the C drive's colon : is removed and the filepath is handled as awsaml://C/Users/theUser/Downloads/awsaml/build/index.html which causes an error due to the filepath not existing. The BrowserWindow is unable to render properly.
Fix:
baseUrl = new URL(`awsaml:///${path.join(__dirname, '/../../build/index.html')}`).toString();
URL object normalizes the file path, which will fix issues with separator variation between OS (/ for POSIX, / or \ for Windows)
Converting the URL path to a string prevents the colon from being stripped out when passed to the protocol handler
The previous released version does not execute properly in Windows machines. This PR implements necessary fixes to allow for an operational Windows installer and executable.
Bug:
awsaml://
protocol handler, which opens and renders the files. On Windows machines, these filepaths will most likely live in theC:/
drive. When the filepath is passed to our protocol handler as a URL - e.g.awsaml://C:/Users/theUser/Downloads/awsaml/build/index.html
- the C drive's colon:
is removed and the filepath is handled asawsaml://C/Users/theUser/Downloads/awsaml/build/index.html
which causes an error due to the filepath not existing. The BrowserWindow is unable to render properly.Fix:
baseUrl = new URL(`awsaml:///${path.join(__dirname, '/../../build/index.html')}`).toString();
/
for POSIX,/
or\
for Windows)