question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get executable APP name in main.js for portable

See original GitHub issue

I see that process.env.PORTABLE_EXECUTABLE_DIR will return executable dir, but how can I get full app name, assume some users would change that app name?

I want to toggle shortcut and startup, which will need dir and app name, C:/Users/${user}/AppData/Local/Temp is not useful since it will change every time.

System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("PORTABLE_EXECUTABLE_DIR", "$EXEDIR").r0'

It only sets PORTABLE_EXECUTABLE_DIR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
kiprobinsoncommented, Apr 19, 2019

For anyone else who finds this- I found that using process.execPath works. I was using an exe built by electron-packager, but not a portable one.

2reactions
develarcommented, Aug 7, 2018

@Cefold Please try 20.27.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get the original path of a portable Electron app?
Is there any way to get the original app.exe path? I've tried the following: app.getAppPath(); __dirname; require.main.filename; app-root-path ...
Read more >
How to create an executable (.exe) file from JavaScript code ...
In this lesson, we are going to learn how to create a .exe binary executable file from JavaScript code. This is possible with...
Read more >
How to get the name of the current executable in C#?
There are several ways to get the name of the current executable in C#. Using System.AppDomain −. Application domain provides isolation ...
Read more >
app | Electron
Control your application's event lifecycle.
Read more >
Build an Electron App in Under 60 Minutes - YouTube
In this video we will build a desktop application using Electron. js which allows us to build desktop apps using only JavaScript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found