How to get the original path of a portable Electron app?

前端 未结 7 1945
伪装坚强ぢ
伪装坚强ぢ 2020-12-24 08:08

I have an Portable Electron App (packed with: electron-builder + asar, portable build) on Windows. I try to get the application path but it returns a path within the user\\t

7条回答
  •  情深已故
    2020-12-24 08:39

    I found a solution: Use the Environment Variable (created by Electron-Builder)

    process.env.PORTABLE_EXECUTABLE_DIR
    

    to show the real Path of the App.exe. Works only packed with Electron-Builder

提交回复
热议问题