summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.nmake15
-rwxr-xr-xpackaging/portableapps/win32/Installer.nsi203
-rwxr-xr-xpackaging/portableapps/win32/WiresharkPortable.ini15
-rwxr-xr-xpackaging/portableapps/win32/WiresharkPortable.nsi271
-rwxr-xr-xpackaging/portableapps/win32/appinfo.tmpl23
-rw-r--r--packaging/portableapps/win32/makefile.nmake82
6 files changed, 609 insertions, 0 deletions
diff --git a/Makefile.nmake b/Makefile.nmake
index 2b6183133e..4a78998fa0 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -154,6 +154,15 @@ packaging_u3: all
cd ..
cd ..
+packaging_papps: all
+ cd packaging
+ cd portableapps
+ cd win32
+ $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
+ cd ..
+ cd ..
+ cd ..
+
# use (info-)zip from cygwin to pack things
packaging_zip1: all
!IFDEF MSVCR_DLL
@@ -401,6 +410,8 @@ clean: clean-local
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
cd ../u3/win32
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+ cd ../../portableapps/win32
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
cd ../../..
# "distclean" removes all files not part of the distribution.
@@ -434,6 +445,8 @@ distclean: distclean-local
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
cd ../u3/win32
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+ cd ../../portableapps/win32
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
cd ../../..
# Make "maintainer-clean" only if you would like to remove ALL generated
@@ -465,6 +478,8 @@ maintainer-clean: maintainer-clean-local
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
cd ../u3/win32
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+ cd ../../portableapps/win32
+ $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
cd ../../..
tools::
diff --git a/packaging/portableapps/win32/Installer.nsi b/packaging/portableapps/win32/Installer.nsi
new file mode 100755
index 0000000000..9e56e240da
--- /dev/null
+++ b/packaging/portableapps/win32/Installer.nsi
@@ -0,0 +1,203 @@
+
+; Installer.nsi - installs Wireshark Portable onto a PortableApps enabled device
+
+; $Id$
+
+;Copyright 2007 John T. Haller
+
+;Website: http://www.wireshark.org/
+
+;This software is OSI Certified Open Source Software.
+;OSI Certified is a certification mark of the Open Source Initiative.
+
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+;EXCEPTION: Can be used with non-GPLed open source apps distributed by PortableApps.com
+
+!define APP "Wireshark"
+!define NAME "Wireshark Portable"
+!define SHORTNAME "WiresharkPortable"
+!define FILENAME "WiresharkPortable"
+!define CHECKRUNNING "WiresharkPortable.exe"
+!define CLOSENAME "Wireshark Portable"
+!define ADDONSDIRECTORYPRESERVE "NONE"
+
+;=== Program Details
+Name "${NAME}"
+OutFile "${FILENAME}-${WSVERSION}.paf.exe"
+InstallDir "\${SHORTNAME}"
+Caption "${NAME} | PortableApps.com Installer"
+VIProductVersion "${VERSION}"
+VIAddVersionKey ProductName "${NAME}"
+VIAddVersionKey Comments "For additional details, visit PortableApps.com"
+VIAddVersionKey CompanyName "PortableApps.com"
+VIAddVersionKey LegalCopyright "PortableApps.com and contributors"
+VIAddVersionKey FileDescription "${NAME}"
+VIAddVersionKey FileVersion "${VERSION}"
+VIAddVersionKey ProductVersion "${VERSION}"
+VIAddVersionKey InternalName "${NAME}"
+VIAddVersionKey LegalTrademarks "PortableApps.com is a Trademark of Rare Ideas, LLC."
+VIAddVersionKey OriginalFilename "${FILENAME}.paf.exe"
+;VIAddVersionKey PrivateBuild ""
+;VIAddVersionKey SpecialBuild ""
+
+;=== Runtime Switches
+;SetDatablockOptimize on
+;SetCompress off
+SetCompressor /SOLID lzma
+CRCCheck on
+AutoCloseWindow True
+RequestExecutionLevel user
+
+;=== Include
+!include MUI.nsh
+!include FileFunc.nsh
+!include LogicLib.nsh
+!insertmacro DriveSpace
+!insertmacro GetOptions
+!insertmacro GetDrives
+!insertmacro GetRoot
+!insertmacro GetSize
+
+;=== Program Icon
+Icon "Files\App\AppInfo\${APP}.ico"
+
+;=== Icon & Stye ===
+!define MUI_ICON "Files\App\AppInfo\wireshark.ico"
+BrandingText "PortableApps.com - Your Digital Life, Anywhere™"
+
+;=== Pages
+;!define MUI_WELCOMEFINISHPAGE_BITMAP wizard.bmp
+!define MUI_WELCOMEPAGE_TITLE "${NAME}"
+!define MUI_WELCOMEPAGE_TEXT "$(welcome)"
+!insertmacro MUI_PAGE_WELCOME
+;!define MUI_LICENSEPAGE_RADIOBUTTONS
+;!insertmacro MUI_PAGE_LICENSE "EULA.txt"
+!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveDirectory
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!define MUI_FINISHPAGE_TEXT "$(finish)"
+!insertmacro MUI_PAGE_FINISH
+
+;=== Languages
+!insertmacro MUI_LANGUAGE "English"
+
+LangString welcome ${LANG_ENGLISH} "This wizard will guide you through the installation of ${NAME}.\r\n\r\nIf you are upgrading an existing installation of ${NAME}, please close it before proceeding.\r\n\r\nClick Next to continue."
+LangString finish ${LANG_ENGLISH} "${NAME} has been installed on your device.\r\n\r\nClick Finish to close this wizard."
+LangString runwarning ${LANG_ENGLISH} "Please close all instances of ${CLOSENAME} and then click OK. The portable app can not be upgraded while it is running."
+LangString invaliddirectory ${LANG_ENGLISH} "The destination folder you selected is invalid. Please choose a valid folder."
+LangString notenoughspace ${LANG_ENGLISH} "The device you have selected to install to does not have enough free space for this app."
+
+;=== Variables
+Var FOUNDPORTABLEAPPSPATH
+
+Function .onInit
+ ;StrCpy $FOUNDPORTABLEAPPSPATH ''
+
+ ${GetOptions} "$CMDLINE" "/DESTINATION=" $R0
+
+ IfErrors CheckLegacyDestination
+ StrCpy $INSTDIR "$R0${SHORTNAME}"
+ Goto InitDone
+
+ CheckLegacyDestination:
+ ClearErrors
+ ${GetOptions} "$CMDLINE" "-o" $R0
+ IfErrors NoDestination
+ StrCpy $INSTDIR "$R0${SHORTNAME}"
+ Goto InitDone
+
+ NoDestination:
+ ClearErrors
+ ${GetDrives} "HDD+FDD" GetDrivesCallBack
+ StrCmp $FOUNDPORTABLEAPPSPATH "" DefaultDestination
+ StrCpy $INSTDIR "$FOUNDPORTABLEAPPSPATH\${SHORTNAME}"
+ Goto InitDone
+
+ DefaultDestination:
+ StrCpy $INSTDIR "\${SHORTNAME}"
+
+ InitDone:
+FunctionEnd
+
+Function GetDrivesCallBack
+ ;=== Skip usual floppy letters
+ StrCmp $8 "FDD" "" CheckForPortableAppsPath
+ StrCmp $9 "A:\" End
+ StrCmp $9 "B:\" End
+
+ CheckForPortableAppsPath:
+ IfFileExists "$9PortableApps" "" End
+ StrCpy $FOUNDPORTABLEAPPSPATH "$9PortableApps"
+
+ End:
+ Push $0
+FunctionEnd
+
+Function LeaveDirectory
+ GetInstDirError $0
+
+ ;=== Does it already exist? (upgrade)
+ IfFileExists "$INSTDIR" "" CheckInstallerError
+ ;=== Check if app is running?
+ StrCmp ${CHECKRUNNING} "NONE" CheckInstallerError
+ FindProcDLL::FindProc "${CHECKRUNNING}"
+ StrCmp $R0 "1" "" CheckInstallerError
+ MessageBox MB_OK|MB_ICONINFORMATION `$(runwarning)`
+ Abort
+
+ CheckInstallerError:
+ ${Switch} $0
+ ${Case} 0 ;=== Valid directory and enough free space
+ ${Break}
+ ${Case} 1
+ MessageBox MB_OK `$(invaliddirectory)`
+ Abort
+ ${Break}
+ ${Case} 2
+ IfFileExists `$INSTDIR` "" NotEnoughSpaceNoUpgrade ;=== Is upgrade
+ SectionGetSize ${SectionMain} $1 ;=== Space Required for App
+ ${GetRoot} `$INSTDIR` $2
+ ${DriveSpace} `$2\` "/D=F /S=K" $3 ;=== Space Free on Device
+ ${GetSize} `$INSTDIR` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Current installation size
+ IntOp $7 $3 + $4 ;=== Space Free + Current Install Size
+ IfFileExists `$INSTDIR\Data` "" CheckPluginsDirectory
+ ${GetSize} `$INSTDIR\Data` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory
+ IntOp $7 $7 - $4 ;=== Remove the data directory from the free space calculation
+
+ CheckPluginsDirectory:
+ StrCmp `${ADDONSDIRECTORYPRESERVE}` "NONE" CalculateSpaceLeft
+ IfFileExists `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` "" CalculateSpaceLeft
+ ${GetSize} `$INSTDIR\${ADDONSDIRECTORYPRESERVE}` "/M=*.* /S=0K /G=1" $4 $5 $6 ;=== Size of Data directory
+ IntOp $7 $7 - $4 ;=== Remove the plugins directory from the free space calculation
+
+ CalculateSpaceLeft:
+ IntCmp $7 $1 NotEnoughSpaceNoUpgrade NotEnoughSpaceNoUpgrade
+ Goto EndNotEnoughSpace
+
+ NotEnoughSpaceNoUpgrade:
+ MessageBox MB_OK `$(notenoughspace)`
+ Abort
+
+ EndNotEnoughSpace:
+ ${Break}
+ ${EndSwitch}
+FunctionEnd
+
+Section "!App Portable (required)"
+ SetOutPath $INSTDIR
+ File /r "Files\*.*"
+SectionEnd \ No newline at end of file
diff --git a/packaging/portableapps/win32/WiresharkPortable.ini b/packaging/portableapps/win32/WiresharkPortable.ini
new file mode 100755
index 0000000000..1dc29e8b1b
--- /dev/null
+++ b/packaging/portableapps/win32/WiresharkPortable.ini
@@ -0,0 +1,15 @@
+#
+# WirersharkPortable.ini - settings for configure the running of WiresharkPortable
+#
+# $Id$
+#
+[WiresharkPortable]
+WiresharkDirectory=App\Wireshark
+WiresharkExecutable=wireshark.exe
+AdditionalParameters=
+#DisableSplashScreen=false
+DisableWinPcapInstall=false
+WinPcapInstaller=WinPcap_4_0_1.exe
+
+# This INI is an example only and will not work until placed according to the directions in readme.txt
+# The above options are explained in the included readme.txt
diff --git a/packaging/portableapps/win32/WiresharkPortable.nsi b/packaging/portableapps/win32/WiresharkPortable.nsi
new file mode 100755
index 0000000000..46b4c18bcf
--- /dev/null
+++ b/packaging/portableapps/win32/WiresharkPortable.nsi
@@ -0,0 +1,271 @@
+
+; WiresharkPortable.nsi - runs Wireshark Portable from a PortableApps enabled device
+
+; $Id$
+
+;Copyright (C) 2004-2007 John T. Haller of PortableApps.com
+
+;Website: http://www.wireshark.org/
+
+;This software is OSI Certified Open Source Software.
+;OSI Certified is a certification mark of the Open Source Initiative.
+
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+!define NAME "WiresharkPortable"
+!define FULLNAME "Wireshark Portable"
+!define APP "Wireshark"
+!define WEBSITE "www.wireshark.org"
+!define DEFAULTEXE "wireshark.exe"
+!define DEFAULTAPPDIR "Wireshark"
+!define DEFAULTSETTINGSDIR "settings"
+!define DEFAULTWINPCAP "WinPcap_4_0_1.exe"
+
+;=== Program Details
+Name "${FULLNAME}"
+OutFile "Files\${NAME}.exe"
+Caption "${FULLNAME} | PortableApps.com"
+VIProductVersion "${VERSION}"
+VIAddVersionKey ProductName "${FULLNAME}"
+VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive. For additional details, visit ${WEBSITE}"
+VIAddVersionKey CompanyName "Wireshark.org"
+VIAddVersionKey LegalCopyright "Gerald Combs"
+VIAddVersionKey FileDescription "${FULLNAME}"
+VIAddVersionKey FileVersion "${VERSION}"
+VIAddVersionKey ProductVersion "${VERSION}"
+VIAddVersionKey InternalName "${FULLNAME}"
+VIAddVersionKey LegalTrademarks "Wireshark and the fin logo are trademarks of Gerald Combs"
+VIAddVersionKey OriginalFilename "${NAME}.exe"
+;VIAddVersionKey PrivateBuild ""
+;VIAddVersionKey SpecialBuild ""
+
+;=== Runtime Switches
+CRCCheck On
+WindowIcon Off
+SilentInstall Silent
+AutoCloseWindow True
+RequestExecutionLevel user
+
+;=== Include
+!include "FileFunc.nsh"
+!insertmacro GetParameters
+;!insertmacro GetRoot
+;!include "ReplaceInFile.nsh"
+;!include "StrRep.nsh"
+
+;=== Program Icon
+Icon "Files/App/AppInfo/${APP}.ico"
+
+Var PROGRAMDIRECTORY
+Var SETTINGSDIRECTORY
+Var ADDITIONALPARAMETERS
+Var EXECSTRING
+Var PROGRAMEXECUTABLE
+Var INIPATH
+Var SECONDARYLAUNCH
+Var DISABLESPLASHSCREEN
+Var DISABLEWINPCAPINSTALL
+Var WINPCAPINSTALLER
+Var WINPCAP_UNINSTALL ;declare variable for holding the value of a registry key
+Var PDRIVE
+
+Section "Main"
+ ;=== Check if already running
+ System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${NAME}") i .r1 ?e'
+ Pop $0
+ StrCmp $0 0 CheckINI
+ StrCpy $SECONDARYLAUNCH "true"
+
+ CheckINI:
+ ;=== Find the INI file, if there is one
+ IfFileExists "$EXEDIR\${NAME}.ini" "" CheckSubINI
+ StrCpy "$INIPATH" "$EXEDIR"
+ Goto ReadINI
+
+ CheckSubINI:
+ IfFileExists "$EXEDIR\${NAME}\${NAME}.ini" "" NoINI
+ StrCpy "$INIPATH" "$EXEDIR\${NAME}"
+ Goto ReadINI
+
+ ReadINI:
+ ;=== Read the parameters from the INI file
+ ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APP}Directory"
+ StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\$0"
+ ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SettingsDirectory"
+ StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\$0"
+
+ ;=== Check that the above required parameters are present
+ IfErrors NoINI
+
+ ReadINIStr $PROGRAMEXECUTABLE "$INIPATH\${NAME}.ini" "${NAME}" "ProgramExecutable"
+ ReadINIStr $ADDITIONALPARAMETERS "$INIPATH\${NAME}.ini" "${NAME}" "AdditionalParameters"
+ ReadINIStr $DISABLESPLASHSCREEN "$INIPATH\${NAME}.ini" "${NAME}" "DisableSplashScreen"
+ ReadINIStr $DISABLEWINPCAPINSTALL "$INIPATH\${NAME}.ini" "${NAME}" "DisableWinPcapInstall"
+ ReadINIStr $WINPCAPINSTALLER "$INIPATH\${NAME}.ini" "${NAME}" "WinPcapInstaller"
+
+ ;CleanUpAnyErrors:
+ ;=== Any missing unrequired INI entries will be an empty string, ignore associated errors
+ ClearErrors
+
+ ;=== Correct PROGRAMEXECUTABLE if blank
+ StrCmp $PROGRAMEXECUTABLE "" "" EndINI
+ StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"
+ Goto EndINI
+
+ ;=== Correct WINPCAPINSTALLER if blank
+ StrCmp $WINPCAPINSTALLER "" "" EndINI
+ StrCpy "$WINPCAPINSTALLER" "${DEFAULTWINPCAP}"
+ Goto EndINI
+
+ NoINI:
+ ;=== No INI file, so we'll use the defaults
+ StrCpy "$ADDITIONALPARAMETERS" ""
+ StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"
+ StrCpy "$WINPCAPINSTALLER" "${DEFAULTWINPCAP}"
+
+ IfFileExists "$EXEDIR\App\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" CheckPortableProgramDIR
+ StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\App\${DEFAULTAPPDIR}"
+ StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\Data\${DEFAULTSETTINGSDIR}"
+ GoTo EndINI
+
+ CheckPortableProgramDIR:
+ IfFileExists "$EXEDIR\${NAME}\App\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" NoProgramEXE
+ StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\${NAME}\App\${DEFAULTAPPDIR}"
+ StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\${NAME}\Data\${DEFAULTSETTINGSDIR}"
+ GoTo EndINI
+
+ EndINI:
+ IfFileExists "$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" FoundProgramEXE
+
+ NoProgramEXE:
+ ;=== Program executable not where expected
+ MessageBox MB_OK|MB_ICONEXCLAMATION `$PROGRAMEXECUTABLE was not found. Please check your configuration`
+ Abort
+
+ FoundProgramEXE:
+ ;=== Check if running
+ StrCmp $SECONDARYLAUNCH "true" GetPassedParameters
+ FindProcDLL::FindProc "${DEFAULTEXE}"
+ StrCmp $R0 "1" WarnAnotherInstance DisplaySplash
+
+ WarnAnotherInstance:
+ MessageBox MB_OK|MB_ICONINFORMATION `Another instance of ${APP} is already running. Please close other instances of ${APP} before launching ${FULLNAME}.`
+ Abort
+
+ DisplaySplash:
+; StrCmp $DISABLESPLASHSCREEN "true" GetPassedParameters
+ ;=== Show the splash screen while processing registry entries
+; InitPluginsDir
+; File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
+; newadvsplash::show /NOUNLOAD 1000 100 0 -1 /L $PLUGINSDIR\splash.jpg
+
+ GetPassedParameters:
+ ;=== Get any passed parameters
+ ${GetParameters} $0
+ StrCmp "'$0'" "''" "" LaunchProgramParameters
+
+ ;=== No parameters
+ StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE"`
+ Goto AdditionalParameters
+
+ LaunchProgramParameters:
+ StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" $0`
+
+ AdditionalParameters:
+ StrCmp $ADDITIONALPARAMETERS "" CheckWinPcap
+
+ ;=== Additional Parameters
+ StrCpy $EXECSTRING `$EXECSTRING $ADDITIONALPARAMETERS`
+
+ CheckWinPcap:
+ StrCmp $DISABLEWINPCAPINSTALL "true" EnvironmentVariables
+
+ ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
+ IfErrors InstallWinPcap
+
+ StrCpy $WINPCAP_UNINSTALL ""
+
+ goto EnvironmentVariables
+
+ InstallWinPcap:
+ MessageBox MB_YESNO "If you want to capture packets from the network you will need to install WinPcap.\nIt will be uninstalled when you exit Wireshark.\n\nDo you want to install WinPcap?" /SD IDYES IDNO EnvironmentVariables
+ ExecWait `"$PROGRAMDIRECTORY\$WINPCAPINSTALLER"`
+ ; remember the uninstall string for when we are done
+ ReadRegStr $WINPCAP_UNINSTALL HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinPcapInst" "UninstallString"
+
+ EnvironmentVariables:
+ ; set the U3 environment variables
+ StrCpy $PDRIVE $EXEDIR 2
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_SERIAL", "0000060414068917").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_PATH", "$PDRIVE").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DOCUMENT_PATH", "$PDRIVE\Documents").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_VENDOR", "Wireshark Developers").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_PRODUCT", "PortableApps").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_VENDOR_ID", "0000").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_APP_DATA_PATH", "$EXEDIR\Data").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_HOST_EXEC_PATH", "$EXEDIR\App\Wireshark").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_DEVICE_EXEC_PATH", "$EXEDIR\App\Wireshark").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_ENV_VERSION", "1.0").r0'
+ System::Call 'Kernel32::SetEnvironmentVariableA(t,t) i("U3_ENV_LANGUAGE", "1033").r0'
+; SettingsDirectory:
+ ;=== Set the settings directory if we have a path
+; IfFileExists "$SETTINGSDIRECTORY\*.*" CheckForSettings
+; CreateDirectory $SETTINGSDIRECTORY
+
+; CheckForSettings:
+ StrCmp $SECONDARYLAUNCH "true" LaunchAndExit
+; IfFileExists "$PROGRAMDIRECTORY\sumatrapdfprefs.txt" AdjustPaths
+; IfFileExists "$SETTINGSDIRECTORY\sumatrapdfprefs.txt" MoveSettings AdjustPaths
+ ;IfFileExists "$EXEDIR\App\DefaultData\sumatrapdfprefs.txt" "" LaunchNow
+ ; CopyFiles /SILENT "$EXEDIR\App\DefaultData\sumatrapdfprefs.txt" "$PROGRAMDIRECTORY"
+ ; Goto LaunchNow
+
+; MoveSettings:
+; Rename "$SETTINGSDIRECTORY\sumatrapdfprefs.txt" "$PROGRAMDIRECTORY\sumatrapdfprefs.txt"
+
+; AdjustPaths:
+; ReadINIStr $LASTDRIVE "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastDrive"
+; ${GetRoot} $EXEDIR $CURRENTDRIVE
+; StrCmp $LASTDRIVE $CURRENTDRIVE RememberPath
+; IfFileExists "$PROGRAMDIRECTORY\sumatrapdfprefs.txt" "" RememberPath
+; ${ReplaceInFile} "$PROGRAMDIRECTORY\sumatrapdfprefs.txt" 'File: $LASTDRIVE' 'File: $CURRENTDRIVE'
+; Delete "$PROGRAMDIRECTORY\sumatrapdfprefs.txt.old"
+
+; RememberPath:
+; WriteINIStr "$SETTINGSDIRECTORY\${NAME}Settings.ini" "${NAME}Settings" "LastDrive" "$CURRENTDRIVE"
+
+ ;LaunchNow:
+ ExecWait $EXECSTRING
+
+ CheckRunning:
+ Sleep 1000
+ FindProcDLL::FindProc "${DEFAULTEXE}"
+ StrCmp $R0 "1" CheckRunning
+
+ ;UninstallWinPcap:
+ StrCmp $WINPCAP_UNINSTALL "" TheEnd ;=== if we installed it, uninstall it
+ ExecWait $WINPCAP_UNINSTALL
+
+ ;=== Put the settings file back
+; Sleep 500
+; Rename "$PROGRAMDIRECTORY\sumatrapdfprefs.txt" "$SETTINGSDIRECTORY\sumatrapdfprefs.txt"
+ Goto TheEnd
+
+ LaunchAndExit:
+ Exec $EXECSTRING
+
+ TheEnd:
+; newadvsplash::wait
+SectionEnd
diff --git a/packaging/portableapps/win32/appinfo.tmpl b/packaging/portableapps/win32/appinfo.tmpl
new file mode 100755
index 0000000000..b6a113268e
--- /dev/null
+++ b/packaging/portableapps/win32/appinfo.tmpl
@@ -0,0 +1,23 @@
+[Format]
+Type=PortableApps.comFormat
+Version=0.9.6
+
+[Details]
+Name=Wireshark Portable
+Publisher=Wireshark.org
+Homepage=www.wireshark.org
+Category=Internet
+Description=Wireshark is one of the world's foremost network protocol analysers.
+InstallSize=TBD
+
+[License]
+Shareable=true
+
+[Version]
+PackageVersion=$(PAPPS_VERSION)
+PackageRevision=$(VERSION_MAJOR)
+DisplayVersion=$(VERSION_MAJOR).$(VERSION_MINOR)
+
+[Control]
+Icons=1
+Start=WiresharkPortable.exe \ No newline at end of file
diff --git a/packaging/portableapps/win32/makefile.nmake b/packaging/portableapps/win32/makefile.nmake
new file mode 100644
index 0000000000..aa8d4addfe
--- /dev/null
+++ b/packaging/portableapps/win32/makefile.nmake
@@ -0,0 +1,82 @@
+#
+# $Id$
+#
+
+include ../../../config.nmake
+include <win32.mak>
+
+FILES = Files
+APP = App
+DATA = Data
+OTHER = Other
+APPINFO = AppInfo
+WIRESHARK = Wireshark
+SOURCE = WiresharkPortableSource
+
+TOPDIR = ..\..\..
+U3DIST = ..\..\u3\win32
+COPY = xcopy
+MKDIR = mkdir
+COPY_FLAGS = /d /y
+UPX = upx301w\upx.exe
+
+PAPPS_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO).0
+
+all: package
+
+package: WiresharkPortable-$(VERSION).paf.exe
+
+dirs:
+ if not exist $(FILES) $(MKDIR) $(FILES)
+ if not exist $(FILES)\$(APP) $(MKDIR) $(FILES)\$(APP)
+ if not exist $(FILES)\$(APP)\$(APPINFO) $(MKDIR) $(FILES)\$(APP)\$(APPINFO)
+ if not exist $(FILES)\$(APP)\$(WIRESHARK) $(MKDIR) $(FILES)\$(APP)\$(WIRESHARK)
+ if not exist $(FILES)\$(DATA) $(MKDIR) $(FILES)\$(DATA)
+ if not exist $(FILES)\$(OTHER) $(MKDIR) $(FILES)\$(OTHER)
+ if not exist $(FILES)\$(OTHER)\$(SOURCE) $(MKDIR) $(FILES)\$(OTHER)\$(SOURCE)
+
+wireshark:
+ cd $(U3DIST)
+ nmake -f makefile.nmake test
+ cd ../../portableapps/win32
+ $(COPY) $(U3DIST)\device\* $(FILES)\$(APP)\$(WIRESHARK) /S $(COPY_FLAGS)
+ $(COPY) $(U3DIST)\host\* $(FILES)\$(APP)\$(WIRESHARK) /S $(COPY_FLAGS)
+# $(UPX) $(FILES)\$(APP)\$(WIRESHARK)\*.dll
+
+appinfo.ini: appinfo.tmpl $(TOPDIR)\config.nmake
+ sed -e 's/$$(PAPPS_VERSION)/$(PAPPS_VERSION)/g' \
+ -e 's/$$(VERSION_MAJOR)/$(VERSION_MAJOR)/g' \
+ -e 's/$$(VERSION_MINOR)/$(VERSION_MINOR)/g' \
+ < appinfo.tmpl > appinfo.ini
+
+appinfo: appinfo.ini
+ $(COPY) appinfo.ini $(FILES)\$(APP)\$(APPINFO) $(COPY_FLAGS)
+ $(COPY) $(TOPDIR)\image\wireshark.ico $(FILES)\$(APP)\$(APPINFO) $(COPY_FLAGS)
+
+source:
+ $(COPY) WiresharkPortable.ini $(FILES)\$(OTHER)\$(SOURCE) $(COPY_FLAGS)
+ $(COPY) WiresharkPortable.nsi $(FILES)\$(OTHER)\$(SOURCE) $(COPY_FLAGS)
+ $(COPY) Installer.nsi $(FILES)\$(OTHER)\$(SOURCE) $(COPY_FLAGS)
+
+
+WiresharkPortable-$(VERSION).paf.exe : dirs appinfo wireshark source Files/WiresharkPortable.exe Installer.nsi
+ $(MAKENSIS) \
+ /DVERSION=$(PAPPS_VERSION) \
+ /DWSVERSION=$(VERSION) \
+ Installer.nsi
+
+Files/WiresharkPortable.exe : WiresharkPortable.nsi
+ $(MAKENSIS) \
+ /DVERSION=$(PAPPS_VERSION) \
+ /DWSVERSION=$(VERSION) \
+ WiresharkPortable.nsi
+
+clean:
+ rm -rf $(FILES)
+ rm -rf appinfo.ini
+ rm -rf WiresharkPortable-$(VERSION).paf.exe
+ rm -rf *~ *.*~
+
+distclean: clean
+
+maintainer-clean: distclean