SecFileExtensions was removed in 2005. Don't reference it. Fixes bug 2793.

Replicate the old SecFileExtensions behavior by disabling and unchecking
the file extensions option when Wireshark is unselected.

While we're at it, add a "PLATFORM" variable to config.nmake, and use
it to set the library directory and installer filename and title.

Add a couple of minor fixes.

svn path=/trunk/; revision=26019
This commit is contained in:
Gerald Combs 2008-08-14 17:54:35 +00:00
parent f7e0b6490a
commit 837f0d9d53
3 changed files with 27 additions and 25 deletions

View File

@ -3,7 +3,9 @@
# Some more informations about the settings in this file, can be found
# in the file README.win32 and the Developer's Guide (available online).
##### Platform #####
# Only "win32" is valid (for now).
PLATFORM=win32
##### Versions #####
@ -30,7 +32,7 @@ WTAP_VERSION_MICRO=1
# Base directory, where your libraries reside, which are needed to
# compile the sources. This setting is used only inside this file.
#
WIRESHARK_LIBS=C:\wireshark-win32-libs
WIRESHARK_LIBS=C:\wireshark-$(PLATFORM)-libs
#
# Base directory, where your programs reside.

View File

@ -82,7 +82,7 @@ NSI=wireshark.nsi \
DELIVERABLES=$(EXE) $(DLL) $(DOC) $(DOC_dos) $(GPL) $(HELP) $(PLUGINS)
all: NEWS.txt wireshark-setup-$(VERSION).exe
all: NEWS.txt wireshark-$(PLATFORM)-$(VERSION).exe
NEWS.txt: ../../NEWS
$(UNIX2DOS) < ../../NEWS > NEWS.txt
@ -92,8 +92,9 @@ user-guide.chm::
if exist ..\..\docbook\user-guide.chm xcopy ..\..\docbook\user-guide.chm . /Y /D
if exist $(WIRESHARK_LIBS)\user-guide\user-guide.chm xcopy $(WIRESHARK_LIBS)\user-guide\user-guide.chm . /Y /D
wireshark-setup-$(VERSION).exe : user-guide.chm $(NSI) $(DELIVERABLES) Makefile.nmake
wireshark-$(PLATFORM)-$(VERSION).exe : user-guide.chm $(NSI) $(DELIVERABLES) Makefile.nmake
$(MAKENSIS) \
/DPLATFORM=$(PLATFORM) \
/DMSVC_VARIANT=$(MSVC_VARIANT) \
!IFDEF MSVCR_DLL
/DMSVCR_DLL="$(MSVCR_DLL)" \
@ -162,14 +163,12 @@ wireshark-setup-$(VERSION).exe : user-guide.chm $(NSI) $(DELIVERABLES) Makefile.
wireshark.nsi
clean:
rm -f wireshark-setup-$(VERSION).exe
rm -f wireshark-gtk2-setup-$(VERSION).exe
rm -f wireshark-$(PLATFORM)-$(VERSION).exe
rm -f NEWS.txt
rm -f user-guide.chm
distclean: clean
rm -f wireshark-setup-*.exe
rm -f wireshark-gtk2-setup-*.exe
rm -f wireshark-$(PLATFORM)-*.exe
maintainer-clean: distclean

View File

@ -19,18 +19,23 @@ InstType "un.All (remove all)"
!define SHCNF_IDLIST 0
; Used to add associations between file extensions and Wireshark
!define WIRESHARK_ASSOC "wireshark-file"
!define WIRESHARK_ASSOC "wireshark-capture-file"
; ============================================================================
; Header configuration
; ============================================================================
; The name of the installer
!define PROGRAM_NAME "Wireshark"
!if ${PLATFORM} == "win32"
!define BITS 32
!else
!define BITS 64
!endif
Name "${PROGRAM_NAME} ${VERSION}"
Name "${PROGRAM_NAME} ${VERSION} (${BITS}-bit)"
; The file to write
OutFile "wireshark-setup-${VERSION}.exe"
OutFile "wireshark-${PLATFORM}-${VERSION}.exe"
; Icon of installer and uninstaller
Icon "..\..\image\wireshark.ico"
@ -577,7 +582,7 @@ SecRequired_skip_QuickLaunchIcon:
; Create File Extensions (depending on additional tasks page)
ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
StrCmp $0 "0" SecRequired_skip_FileExtensions
WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark file"
WriteRegStr HKCR ${WIRESHARK_ASSOC} "" "Wireshark capture file"
WriteRegStr HKCR "${WIRESHARK_ASSOC}\Shell\open\command" "" '"$INSTDIR\wireshark.exe" "%1"'
WriteRegStr HKCR "${WIRESHARK_ASSOC}\DefaultIcon" "" '"$INSTDIR\wireshark.exe",1'
push $R0
@ -1096,27 +1101,23 @@ SectionEnd
; Callback functions
; ============================================================================
!ifdef GTK_DIR
; Disable FileExtension if Wireshark isn't selected
; Disable File extensions if Wireshark isn't selected
Function .onSelChange
Push $0
SectionGetFlags ${SecWireshark} $0
IntOp $0 $0 & 1
IntCmp $0 0 onSelChange.unselect
SectionGetFlags ${SecFileExtensions} $0
IntOp $0 $0 & 16
IntCmp $0 16 onSelChange.unreadonly
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 1
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" ""
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" ""
Goto onSelChange.end
onSelChange.unselect:
SectionGetFlags ${SecFileExtensions} $0
IntOp $0 $0 & 0xFFFFFFFE
IntOp $0 $0 | 0x10
SectionSetFlags ${SecFileExtensions} $0
Goto onSelChange.end
onSelChange.unreadonly:
SectionGetFlags ${SecFileExtensions} $0
IntOp $0 $0 & 0xFFFFFFEF
SectionSetFlags ${SecFileExtensions} $0
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State" 0
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "Flags" "DISABLED"
WriteINIStr "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 7" "Flags" "DISABLED"
Goto onSelChange.end
onSelChange.end:
Pop $0
FunctionEnd