Уважаемый
kotkovets, ощущается нехватка информации по созданию инсталляторов, совместимых с установкой на 64-битные системы. Если аспекты распаковки файлов и регистрации библиотек более менее понятны, то работа со строками реестра представляет сложности. К примеру, написал сегодня скрипт, в котором регистрируются разные dll в зависимости от разрядности системы, скрипт вроде не сложный, а что поправить для совместимости с реестром 64 не совсем ясно. Не помешала бы небольшая инструкция в дополнение к справке на примере простого скрипта.
Например такой скрипт:
Код:

!define MUI_WELCOMEFINISHPAGE_BITMAP "D:\NSIS\Jame2.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "D:\NSIS\Jame2.bmp"
!define PRODUCT_NAME "TreeSize Professional"
!define PRODUCT_VERSION "5.5.0.776"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define pkgdir "D:\NSIS"
!define FSizeDLL "${pkgdir}\TreeSize\FSizeCol.dll"
!define HelpLink "http://www.jam-software.de/customers/contact.php?language=EN&article_no=101&version_no=5.4.3.702"
!define URLInfoAbout "http://www.jam-software.com"
!define URLUpdateInfo "https://www.jam-software.de/customers/index.php?language=EN"
!define PRODUCT_WEB_SITE "http://www.jam-software.com"
!define Comments "Программа, анализирующая пространство на жестком диске вашего компьютера!"
;
; MUI 1.67 compatible
!include "MUI2.nsh"
!include "Library.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"
;
SetCompressor /SOLID lzma
;
; MUI Settings
;
!define MUI_ABORTWARNING
!define MUI_ICON "D:\NSIS\TreeSize.ico"
!define MUI_UNICON "D:\NSIS\modern-uninstall-blue-full.ico"
!define MUI_COMPONENTSPAGE_SMALLDESC
;
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;
; Language files
!insertmacro MUI_LANGUAGE "Russian"
;
!define RmEmptyDir "!insertmacro PathIsDirectoryEmpty"
!macro PathIsDirectoryEmpty Dir
Push `${Dir}`
System::Store S
System::Call "Shlwapi::PathIsDirectoryEmpty(tsR1)i.R0"
StrCmp $R0 1 0 +2
RmDir `$R1`
System::Store L
!macroend
;
; MUI end ------
Name "${PRODUCT_NAME}"
Caption "${PRODUCT_NAME} ${PRODUCT_VERSION}"
UninstallCaption "Удаление ${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\JAM Software\TreeSize Professional"
BrandingText "${BRANDING}"
;
Section "!${PRODUCT_NAME} (Установка программы)" Install
;
SetOutPath "$INSTDIR"
File "${pkgdir}\TreeSize\FSizeCol.dll"
File "${pkgdir}\TreeSize\FSizeCol64.dll"
File "${pkgdir}\TreeSize\license.En.rtf"
File "${pkgdir}\TreeSize\TreeSize.chm"
File "${pkgdir}\TreeSize\TreeSize.exe"
File "${pkgdir}\TreeSize\TreeSize.pdf"
File "${pkgdir}\TreeSize\tsizepro.css"
File "${pkgdir}\TreeSize\tsizepro.xsl"
File "${pkgdir}\TreeSize\tszurl.ico"
;
WriteUninstaller "$INSTDIR\uninst.exe"
;
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME} v${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\TreeSize.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "${HelpLink}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${URLInfoAbout}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${URLUpdateInfo}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Comments" "${Comments}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "JAM Software"
;
${If} ${RunningX64}
ExecWait 'regsvr32 /s "$INSTDIR\FSizeCol64.dll"'
${Else}
ExecWait 'regsvr32 /s "$INSTDIR\FSizeCol.dll"'
${EndIf}
;
WriteRegStr HKLM "SOFTWARE\Classes\Folder\shellex\ColumnHandlers\{0BC1E559-9D68-4E99-AFD9-98D27DAB971D}" "" "TreeSize FolderSizeColumn"
;
WriteRegStr HKLM "SOFTWARE\CodeGear" "" ""
WriteRegStr HKLM "SOFTWARE\CodeGear\Locales" "$INSTDIR\TreeSize.exe" "EN"
;
WriteRegStr HKCU "Software\JAM Software\TreeSize Professional" "" ""
WriteRegDWORD HKCU "Software\JAM Software\TreeSize Professional\Shell Column" "Decimals" 0x1
WriteRegDWORD HKCU "Software\JAM Software\TreeSize Professional\Shell Column" "Unit" 0x2
SectionEnd
;
!macro CreateInternetShortcut FILENAME URL ICONFILE ICONINDEX
WriteINIStr "${FILENAME}.url" "InternetShortcut" "URL" "${URL}"
WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconFile" "${ICONFILE}"
WriteINIStr "${FILENAME}.url" "InternetShortcut" "IconIndex" "${ICONINDEX}"
!macroend
;
SectionGroup "Создать ярлыки TreeSize Professional" Shortcuts
Section "Создать группу ярлыков в меню Пуск" Startmenu
SetOutPath "$INSTDIR"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\TreeSize.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Поиск файлов.lnk" "$INSTDIR\TreeSize.exe" /SEARCH
;CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Поиск дублирующихся файлов.lnk" "$INSTDIR\TreeSize.exe" /SEARCH ;/TABS 4
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Руководство пользователя.lnk" "$INSTDIR\TreeSize.pdf"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Справка.lnk" "$INSTDIR\TreeSize.chm"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Удалить ${PRODUCT_NAME}.lnk" "$INSTDIR\uninst.exe"
!insertmacro CreateInternetShortcut \
"$SMPROGRAMS\${PRODUCT_NAME}\Домашняя страница ${PRODUCT_NAME}" \
"${PRODUCT_WEB_SITE}" \
"$INSTDIR\tszurl.ico" "0"
SectionEnd
;
Section "Разместить ярлык на Рабочем столе" Desktop
SetOutPath "$INSTDIR"
CreateShortCut "$Desktop\${PRODUCT_NAME}.lnk" "$INSTDIR\TreeSize.exe"
SectionEnd
;
Section "Добавить ярлык в Панель быстрого запуска" Quicklaunch
SetOutPath "$INSTDIR"
CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\TreeSize.exe"
SectionEnd
SectionGroupEnd
;
SectionGroup "Интегрировать в контекстное меню" Context
Section "Интегрировать TreeSize Professional 5" TreeSize
SetOutPath $INSTDIR
WriteRegStr HKCU "Software\Classes\Directory\shell\TreeSize Professional" "" "TreeSize Professional &5"
WriteRegStr HKCU "Software\Classes\Directory\shell\TreeSize Professional\command" "" "$\"$INSTDIR\TreeSize.exe$\" /CONTEXT $\"%1$\""
;
WriteRegStr HKCU "Software\Classes\Drive\shell\TreeSize Professional" "" "TreeSize Professional &5"
WriteRegStr HKCU "Software\Classes\Drive\shell\TreeSize Professional\command" "" "$\"$INSTDIR\TreeSize.exe$\" /CONTEXT $\"%1$\""
SectionEnd
;
Section "Интегрировать File Search" FileSearch
SetOutPath $INSTDIR
WriteRegStr HKCU "Software\Classes\Directory\shell\TreeSize_fs" "" "TreeSize &File Search"
WriteRegStr HKCU "Software\Classes\Directory\shell\TreeSize_fs\command" "" "$\"$INSTDIR\TreeSize.exe$\" /SEARCH /TABS 5 $\"%1$\""
;
WriteRegStr HKCU "Software\Classes\Drive\shell\TreeSize_fs" "" "TreeSize Professional &File Search"
WriteRegStr HKCU "Software\Classes\Drive\shell\TreeSize_fs\command" "" "$\"$INSTDIR\TreeSize.exe$\" /SEARCH /TABS 5 $\"%1$\""
SectionEnd
SectionGroupEnd
;
Function un.onInit
SectionSetText ${Uninstall} "Удалить программу ${PRODUCT_NAME}"
FunctionEnd
Section Uninstall Uninstall
SectionIn 1 RO
KillProcDLL::KillProc "TreeSize.exe"
Sleep 700
;
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
Delete "$Desktop\${PRODUCT_NAME}.lnk"
Delete "$QUICKLAUNCH\${PRODUCT_NAME}.lnk"
;
${If} ${RunningX64}
ExecWait 'regsvr32 /s /u "$INSTDIR\FSizeCol64.dll"'
${Else}
ExecWait 'regsvr32 /s /u "$INSTDIR\FSizeCol.dll"'
${EndIf}
;
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKCU "Software\JAM Software\TreeSize Professional" ""
DeleteRegKey /ifempty HKCU "Software\JAM Software"
DeleteRegKey HKLM "SOFTWARE\JAM Software\TreeSize Professional" ""
DeleteRegKey /ifempty HKLM "SOFTWARE\JAM Software"
DeleteRegValue HKLM "SOFTWARE\CodeGear\Locales" "$INSTDIR\TreeSize.exe"
DeleteRegKey /ifempty HKLM "SOFTWARE\CodeGear"
;
DeleteRegKey HKCU "Software\Classes\Directory\shell\TreeSize_fs" ""
DeleteRegKey HKCU "Software\Classes\Drive\shell\TreeSize_fs" ""
DeleteRegKey HKCU "Software\Classes\Directory\shell\TreeSize Professional" ""
DeleteRegKey HKCU "Software\Classes\Drive\shell\TreeSize Professional" ""
DeleteRegKey HKLM "SOFTWARE\Classes\CLSID\{0BC1E559-9D68-4E99-AFD9-98D27DAB971D}" ""
DeleteRegKey HKLM "SOFTWARE\Classes\FSizeCol.JamFolderSizeColumn" ""
DeleteRegKey HKLM "SOFTWARE\Classes\Folder\shellex\ColumnHandlers\{0BC1E559-9D68-4E99-AFD9-98D27DAB971D}" ""
RMDir /r /REBOOTOK "$INSTDIR"
${RmEmptyDir} "$PROGRAMFILES\JAM Software"
SetAutoClose true
SectionEnd