neutralinojs/neutralinojs

NL_PATH doesn't get translation of a Windows system folder

aoor9 opened this issue · 2 comments

Describe the bug
My app uses a bundled nodejs service as extension, and I'm deploying it as msi through InnoSetup. After installing it, I can find it inside Program Files, or Program Files (x86). But when I start the app from there, the extension isn't loaded, even though it's inside the correct path.

The NL_PATH says like this: C:/Program Files/app, which is technically correct, however it's not effective when Windows is set to another language. For example, the Program Files folder is renamed to Programmi in italian. So when I change the extensions command with a static path:

"C:\\Program Files\\app\\bin\\service.exe" // not working
"C:\\Programmi\\app\\bin\\service.exe" // working

To Reproduce

  1. Write an app which prints NL_PATH variable on console
  2. Input NL_PATH in extensions section of neutralino.config.js (eg. "${NL_PATH}/bin/service.exe")
  3. neu build (with enableInspector set to true)
  4. Move dist folder inside (translation of) Program Files folder and rename it
  5. Click the main exe

Expected behavior
NL_PATH should consider translations of system folders

Specifications

  • OS: Windows 11 x64
  • Neutralinojs version: v4.15.0
  • Neutralinojs client library version: v3.13.0
  • Neutralinojs CLI version: [e.g. v9.1.2]

Additional context
I was also trying to move the extension to another folder, like C:\app\bin\service.exe, and all I needed is the system drive (C:\). But I can't retrieve it dynamically from NL_PATH when declared inside the config file. So, any chance to export a new global variable?

Hello, @aoor9 thanks for posting this issue. Did you try using "commandWindows": "\"${NL_PATH}/bin/service.exe\"" ?

Hello, @aoor9 thanks for posting this issue. Did you try using "commandWindows": "\"${NL_PATH}/bin/service.exe\"" ?

It worked, despite the quotes inside the string being required to make it so.