1

I'm trying to write a Scoop app manifest for a program (JAGS) with a NSIS installer. I want to run the installer from PowerShell.

The NSIS documentation says to use the /D switch to set the installation directory. However, the installer uses NSIS's MUI macro to allow setting the directory in the graphical installer. For some reason, this doesn't respect the /D switch. Is there another way to force NSIS MUI to install to a particular directory?

Metalurgia
  • 487
  • 1
  • 4
  • 8

1 Answers1

1

This has nothing to do with MUI, it is because they are using the MultiUser header file.

/D just sets $InstDir before any code in the installer runs and MultiUser changes $InstDir in .onInit overriding anything set with /D.

You can trick it to believe it is already installed:

!define JAGS_VERSION ??? ; I don't know which version but you probably do, or check your registry
WriteRegStr HKCU "SOFTWARE\JAGS\JAGS-${JAGS_VERSION}" "InstallDir" "c:\new dir for single user"
WriteRegStr HKLM "SOFTWARE\JAGS\JAGS-${JAGS_VERSION}" "InstallDir" "c:\new dir for all users"
Anders
  • 97,548
  • 12
  • 110
  • 164