Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Install in the local user's application data directory, if we have to.

  • Loading branch information...
commit e396631aee1d48452fa43fe2067b6614f2746df4 1 parent 3030ee2
@protz authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 install.nsi
View
10 install.nsi
@@ -55,7 +55,6 @@ InstallDir "$PROGRAMFILES32\${MUI_PRODUCT}"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OCaml"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
-!define MUI_DIRECTORYPAGE_TEXT_TOP "Important: if you're not an administrator for this machine, now is the right time to pick another location (e.g. My Documents)."
Var STARTMENUFOLDER
@@ -88,6 +87,11 @@ Var STARTMENUFOLDER
; Main entry point
Function .onInit
!insertmacro MULTIUSER_INIT
+
+ ${If} $MultiUser.InstallMode == "CurrentUser"
+ StrCpy $INSTDIR "$APPDATA\${MUI_PRODUCT}"
+ ${EndIf}
+
FunctionEnd
Section "OCaml" SecOCaml
@@ -147,6 +151,8 @@ Section "OCaml" SecOCaml
DetailPrint "Error: $MultiUser.InstallMode unexpected value"
${EndIf}
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
; There's already a file like that in the original directory, so remove it,
; and write the correct values
@@ -427,4 +433,6 @@ Section "Uninstall"
DetailPrint "Error: $MultiUser.InstallMode unexpected value"
${EndIf}
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
SectionEnd
Please sign in to comment.
Something went wrong with that request. Please try again.