From 8b062785eafcb7a40c6b0084ec45128b1746ffc0 Mon Sep 17 00:00:00 2001 From: freem Date: Wed, 20 Aug 2014 15:28:09 -0500 Subject: [PATCH] Change Windows installer to use the root drive, instead of a hardcoded C:\ (fixes #271) --- stepmania.nsi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stepmania.nsi b/stepmania.nsi index 3ee9a2ccf9..f3bf3acb33 100644 --- a/stepmania.nsi +++ b/stepmania.nsi @@ -54,7 +54,9 @@ ; I think it may need actual admin privs for writing to the registry... -aj ;RequestExecutionLevel user - InstallDir "C:\Games\${PRODUCT_ID}" + ; $INSTDIR is defined in .onInit below. Old line is left here just in case. + ;InstallDir "C:\Games\${PRODUCT_ID}" + InstallDir "${INSTDIR}" InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${PRODUCT_ID}" "" ; DirShow show ; (make this hide to not let the user change it) @@ -689,6 +691,11 @@ Function .onInit ;!define MUI_LANGDLL_ALWAYSSHOW !insertmacro MUI_LANGDLL_DISPLAY + ; determine root drive where Windows was installed, and suggest a + ; reasonable directory for installation. + StrCpy $0 "$WINDIR" 2 + StrCpy $INSTDIR "$0\Games\${PRODUCT_ID}" + !ifdef SHOW_AUTORUN ; ; Extract files for the InstallOptions page