Electron-builder change default installation directory


#1

Hi community :slight_smile:

I use electron-builder for packaging my Electron App. I would change the default installation directory C:\Users\UserName\AppData…

I’ve try to add installer.nsh with custom path in my build folder, but no result.

!macro preInit
SetRegView 64
WriteRegExpandStr HKLM “{INSTALL_REGISTRY_KEY}" InstallLocation "C:\myApp" WriteRegExpandStr HKCU "{INSTALL_REGISTRY_KEY}” InstallLocation “C:\myApp”
SetRegView 32
WriteRegExpandStr HKLM “{INSTALL_REGISTRY_KEY}" InstallLocation "C:\myApp" WriteRegExpandStr HKCU "{INSTALL_REGISTRY_KEY}” InstallLocation “C:\myApp”
!macroend

And my electron-builder.yml :

nsis:
allowToChangeInstallationDirectory: true
oneClick: false
perMachine: false

Anyone can help me ? :slight_smile:

Thank you community !