Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to modify default installation path #8592

Open
1758205847 opened this issue Oct 12, 2024 · 0 comments
Open

Failed to modify default installation path #8592

1758205847 opened this issue Oct 12, 2024 · 0 comments

Comments

@1758205847
Copy link

  • Electron-Builder Version: 25.1.7
  • Node Version: v18.20.4
  • Electron Version:13.6.9
  • Electron Type (current, beta, nightly):
  • Target:

use StrCpy $INSTDIR 'xxx' ,but failed to change install dir.

When using StrCpy $INSTDIR 'xxxx' in customInit, using MessgeBox to output $INSTDIR is indeed modified successfully, but it is subsequently overwritten with the InstallLocation value in the registry.

use WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\MyApp" ,got some problem

I tried to modify the installation path using the following method. This works, but it also creates a problem. That is, the registry was changed when the user canceled the installation, causing the previous installation to not be correctly uninstalled. Is there a callback that is triggered when the user cancels the installation. This will allow me to change the registry back within it.

!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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant