Try to handle attempts at installing 64-bit Wireshark on a 32-bit system.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Apr 2009 17:32:48 +0000 (17:32 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Apr 2009 17:32:48 +0000 (17:32 +0000)
Fix Win64 package building.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28077 f5534014-38df-0310-8fa8-9805f1628bb7

packaging/nsis/Makefile.nmake
packaging/nsis/wireshark.nsi
packaging/nsis/x64.nsh [new file with mode: 0644]

index 944ecd0f384de2def8ef70ed00c1138529d0de69..559d2cb1059f26c9ca0775c3173ab8279b3563ef 100644 (file)
@@ -100,9 +100,11 @@ wireshark-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).exe : user-guide.chm $(NSI) $(
 !ENDIF
 !IFDEF NEED_LIBJPEG_DLL
        /DNEED_LIBJPEG_DLL=$(NEED_LIBJPEG_DLL) \
+       /DJPEG_DLL=$(JPEG_DLL) \
 !ENDIF
 !IFDEF NEED_LIBTIFF_DLL
        /DNEED_LIBTIFF_DLL=$(NEED_LIBTIFF_DLL) \
+       /DTIFF_DLL=$(TIFF_DLL) \
 !ENDIF
 !IFDEF NEED_CAIRO_DLL
        /DNEED_CAIRO_DLL=$(NEED_CAIRO_DLL) \
@@ -117,6 +119,7 @@ wireshark-$(WIRESHARK_TARGET_PLATFORM)-$(VERSION).exe : user-guide.chm $(NSI) $(
        /DICONV_DIR=$(ICONV_DIR) \
 !ENDIF
        /DGETTEXT_DIR=$(GETTEXT_DIR) \
+       /DGETTEXT_DLL=$(GETTEXT_DLL) \
        /DVERSION=$(VERSION) \
        /DWTAP_VERSION=$(WTAP_VERSION) \
 !IF "$(C_ARES_DIR)" != ""
index 93d813722eec26f6fffc9ad8ea0cdf9f1eed5f41..1c5f8e5178e3758b1a6c1d90dac7b69877c71ec3 100644 (file)
@@ -262,7 +262,19 @@ Var OLD_INSTDIR
 Var OLD_DISPLAYNAME
 Var TMP_UNINSTALLER
 
+!include x64.nsh
+
 Function .onInit
+  !if ${WIRESHARK_TARGET_PLATFORM} == "win64"
+    ; http://forums.winamp.com/printthread.php?s=16ffcdd04a8c8d52bee90c0cae273ac5&threadid=262873
+    ${If} ${RunningX64}
+      ${EnableX64FSRedirection}
+    ${else}
+      MessageBox MB_OK "This version of Wireshark only runs on x64 machines.\nTry installing the 32-bit version instead."
+      Abort
+    ${EndIf}
+  !endif
+
   ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
   ReadRegStr $OLD_UNINSTALLER HKLM \
     "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wireshark" \
@@ -354,7 +366,7 @@ File "${GLIB_DIR}\bin\libgmodule-2.0-0.dll"
 !ifdef ICONV_DIR
 File "${ICONV_DIR}\bin\iconv.dll"
 !endif
-File "${GETTEXT_DIR}\bin\intl.dll"
+File "${GETTEXT_DIR}\bin\${GETTEXT_DLL}"
 !ifdef ZLIB_DIR
 File "${ZLIB_DIR}\zlib1.dll"
 !endif
@@ -745,17 +757,21 @@ File "${GTK_DIR}\bin\libpangocairo-1.0-0.dll"
 File "${GTK_DIR}\bin\libpng12-0.dll"
 !endif
 !ifdef NEED_LIBTIFF_DLL
-File "${GTK_DIR}\bin\libtiff3.dll"
+File "${GTK_DIR}\bin\${TIFF_DLL}"
 !endif
 !ifdef NEED_LIBJPEG_DLL
-File "${GTK_DIR}\bin\jpeg62.dll"
+File "${GTK_DIR}\bin\${JPEG_DLL}"
 !endif
 SetOutPath $INSTDIR\etc\gtk-2.0
 File "${GTK_DIR}\etc\gtk-2.0\*.*"
+
+!if ${WIRESHARK_TARGET_PLATFORM} == "win32"
 SetOutPath $INSTDIR\etc\pango
 File "${GTK_DIR}\etc\pango\pango.*"
 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\loaders
 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\loaders\libpixbufloader-*.dll"
+!endif
+
 SetOutPath $INSTDIR\lib\gtk-2.0\${GTK_LIB_DIR}\engines
 File "${GTK_DIR}\lib\gtk-2.0\${GTK_LIB_DIR}\engines\libpixmap.dll"
 SetOutPath $INSTDIR\lib\gtk-2.0\modules
diff --git a/packaging/nsis/x64.nsh b/packaging/nsis/x64.nsh
new file mode 100644 (file)
index 0000000..e694c1e
--- /dev/null
@@ -0,0 +1,54 @@
+; ---------------------
+;       x64.nsh
+; ---------------------
+;
+; A few simple macros to handle installations on x64 machines.
+;
+; RunningX64 checks if the installer is running on x64.
+;
+;   ${If} ${RunningX64}
+;     MessageBox MB_OK "running on x64"
+;   ${EndIf}
+;
+; DisableX64FSRedirection disables file system redirection.
+; EnableX64FSRedirection enables file system redirection.
+;
+;   SetOutPath $SYSDIR
+;   ${DisableX64FSRedirection}
+;   File some.dll # extracts to C:\Windows\System32
+;   ${EnableX64FSRedirection}
+;   File some.dll # extracts to C:\Windows\SysWOW64
+;
+
+!ifndef ___X64__NSH___
+!define ___X64__NSH___
+
+!include LogicLib.nsh
+
+!macro _RunningX64 _a _b _t _f
+  !insertmacro _LOGICLIB_TEMP
+  System::Call kernel32::GetCurrentProcess()i.s
+  System::Call kernel32::IsWow64Process(is,*i.s)
+  Pop $_LOGICLIB_TEMP
+  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+
+!define RunningX64 `"" RunningX64 ""`
+
+!macro DisableX64FSRedirection
+
+  System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
+
+!macroend
+
+!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
+
+!macro EnableX64FSRedirection
+
+  System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
+
+!macroend
+
+!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
+
+!endif # !___X64__NSH___