I am creating an electron app installer using electron-builder. I can change the default installation directory using a macro in build/installer.nsh as follows:
!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
This works for me and my app can install under C:\myApp .
However, I would like for it to install under C:\USER_HOME_DIR\myApp. I have tried using "$(HOME)\myApp", "${HOME}\myApp", "%HOME%\myApp" to no avail. I feel like I am missing something simple in how to reference the evironmental variable pointing to the user's home directory but don't know how.
Any help will be much appreciated.
Many thanks,
Arun