From 48d1d71bad58248c89da706ba590281e106a6e1e Mon Sep 17 00:00:00 2001 From: "SND\\air_max_cp" Date: Sat, 19 Mar 2011 10:04:58 +0000 Subject: [PATCH] [~] Improve install directory storing and retrieving. git-svn-id: https://pykd.svn.codeplex.com/svn@62820 9b283d60-5439-405e-af05-b73fd8c4d996 --- setup/pykd_setup_common.nsh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/setup/pykd_setup_common.nsh b/setup/pykd_setup_common.nsh index deebb16..2e308b2 100644 --- a/setup/pykd_setup_common.nsh +++ b/setup/pykd_setup_common.nsh @@ -42,9 +42,6 @@ OutFile "${PRODUCT_SHORT_NAME}_${PRODUCT_ARCH}_${PRODUCT_VERSION}_setup.exe" BrandingText "${PRODUCT_FULL_NAME}" -#Get installation folder from registry if available -InstallDirRegKey HKLM "Software\${PRODUCT_SHORT_NAME}" "${PRODUCT_ARCH}" - #Request application privileges for Windows Vista and 7 RequestExecutionLevel admin @@ -116,12 +113,22 @@ Function .onInit Abort ${EndIf} + !if ${PRODUCT_ARCH} == "x64" ${IfNot} ${RunningX64} MessageBox MB_OK|MB_ICONEXCLAMATION "This installation requires 64-bit OS." Abort ${EndIf} !endif + + # Get installation folder from registry if available + !if ${PRODUCT_ARCH} == "x64" + ${IfThen} ${RunningX64} ${|} SetRegView 64 ${|} + !endif + ReadRegStr $INSTDIR HKLM "Software\${PRODUCT_SHORT_NAME}" "InstallPath" + !if ${PRODUCT_ARCH} == "x64" + ${IfThen} ${RunningX64} ${|} SetRegView 32 ${|} + !endif FunctionEnd @@ -244,5 +251,11 @@ SectionEnd Section -FinishSection #Store installation folder - WriteRegStr HKLM "Software\${PRODUCT_SHORT_NAME}" "${PRODUCT_ARCH}" "$INSTDIR" + !if ${PRODUCT_ARCH} == "x64" + ${IfThen} ${RunningX64} ${|} SetRegView 64 ${|} + !endif + WriteRegStr HKLM "Software\${PRODUCT_SHORT_NAME}" "InstallPath" "$INSTDIR" + !if ${PRODUCT_ARCH} == "x64" + ${IfThen} ${RunningX64} ${|} SetRegView 32 ${|} + !endif SectionEnd