[~] Improve install directory storing and retrieving.

git-svn-id: https://pykd.svn.codeplex.com/svn@62820 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\air_max_cp 2011-03-19 10:04:58 +00:00
parent 3506801d3b
commit 48d1d71bad

View File

@ -42,9 +42,6 @@ OutFile "${PRODUCT_SHORT_NAME}_${PRODUCT_ARCH}_${PRODUCT_VERSION}_setup.exe"
BrandingText "${PRODUCT_FULL_NAME}" 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 #Request application privileges for Windows Vista and 7
RequestExecutionLevel admin RequestExecutionLevel admin
@ -116,12 +113,22 @@ Function .onInit
Abort Abort
${EndIf} ${EndIf}
!if ${PRODUCT_ARCH} == "x64" !if ${PRODUCT_ARCH} == "x64"
${IfNot} ${RunningX64} ${IfNot} ${RunningX64}
MessageBox MB_OK|MB_ICONEXCLAMATION "This installation requires 64-bit OS." MessageBox MB_OK|MB_ICONEXCLAMATION "This installation requires 64-bit OS."
Abort Abort
${EndIf} ${EndIf}
!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 FunctionEnd
@ -244,5 +251,11 @@ SectionEnd
Section -FinishSection Section -FinishSection
#Store installation folder #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 SectionEnd