www.pudn.com > sswf-1.7.4-src.zip > sswf-win32.nsi


# 
# NSIS Installer information for Win32 
# Written by Alexis Wilke for Made to Order Software, Ltd. (c) 2002-2006 
# 
# Copyright (c) 2002-2006 Made to Order Software, Ltd. 
# 
# Permission is hereby granted, free of charge, to any 
# person obtaining a copy of this software and 
# associated documentation files (the "Software"), to 
# deal in the Software without restriction, including 
# without limitation the rights to use, copy, modify, 
# merge, publish, distribute, sublicense, and/or sell 
# copies of the Software, and to permit persons to whom 
# the Software is furnished to do so, subject to the 
# following conditions: 
# 
# The above copyright notice and this permission notice 
# shall be included in all copies or substantial 
# portions of the Software. 
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 
# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 
# EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
# SOFTWARE. 
# 
 
# 
# Here you find the Installer version and the SSWF package version 
# The installer version is saved as the last number in the VERSION 
# string of the installer (see below) 
# 
!define	INSTALLER_VERSION 2 
!define VERSION  
Name "ScriptSWF " 
Caption "ScriptSWF  Installer" 
OutFile sswf-${VERSION}-win32-i686.exe 
SetCompress auto 
SetCompressor lzma 
SetDateSave on 
SetDatablockOptimize on 
CRCCheck on 
SilentInstall normal 
XPStyle on 
# Don't put a \ after the version so that way the installer forces 
# it after the path the user selects with the Browse button! 
InstallDir "$PROGRAMFILES\Made to Order Software Ltd\sswf\${VERSION}" 
InstallDirRegKey HKLM "Software\Made to Order Software, Ltd.\sswf" "InstallDir" 
InstType "Everything (Full)" 
InstType "Tools, Scripts, Documentation (Standard)" 
InstType "Tools and Scripts only (Light)" 
InstType "SSWF and C++ Samples" 
InstType "Development Files" 
InstType "Source only (Developers)" 
 
!define LANG_ENGLISH	1033 
VIProductVersion "${VERSION}.${INSTALLER_VERSION}" 
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "ScriptSWF" 
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A scripting language and a library to create SWF files on your server, from a DOS prompt, a shell, your software" 
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Made to Order Software, Ltd." 
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© 2002-2006 by Made to Order Software, Ltd." 
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "ScriptSWF Installer" 
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION}.${INSTALLER_VERSION}" 
 
# Pages for installation 
PageEx license 
	LicenseData "doc\LICENSE.txt" 
	LicenseText "ScritSWF License" 
	LicenseForceSelection off 
PageExEnd 
 
PageEx components 
	ComponentText "ScritSWF" 
PageExEnd 
 
PageEx directory 
PageExEnd 
 
PageEx instfiles 
PageExEnd 
 
# Pages for uninstalling 
UninstPage uninstConfirm 
UninstPage instfiles 
 
 
# Sections - where files to be installed are listed 
Section "-base" 
	SectionIn 1 2 3 4 5 6 
	SetDetailsPrint both 
	DetailPrint "Installing the ScriptSWF  uninstaller" 
	SetDetailsPrint listonly 
	SetOutPath "$INSTDIR\${VERSION}\bin" 
	WriteUninstaller "${VERSION}\bin\uninstall-sswf-${VERSION}.exe" 
 
	WriteRegExpandStr	HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "UninstallString" '"$INSTDIR\${VERSION}\bin\uninstall-sswf-${VERSION}.exe"' 
	WriteRegExpandStr	HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "InstallLocation" "$INSTDIR" 
	WriteRegStr		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "DisplayName" "ScriptSWF  Tools" 
	#WriteRegStr		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "DisplayIcon" "$INSTDIR\${VERSION}\bin\sswf.exe,0" 
	WriteRegStr		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "DisplayVersion" "${VERSION}" 
	WriteRegDWORD		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "VersionMajor" "" 
	WriteRegDWORD		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "VersionMinor" "." 
	WriteRegStr		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "URLInfoAbout" "http://sswf.sourceforge.net/" 
	WriteRegDWORD		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "NoModify" "1" 
	WriteRegDWORD		HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "NoRepair" "1" 
 
	# Always install the readme and license 
	SetOutPath "$INSTDIR\${VERSION}" 
	File README.txt 
	SetOutPath "$INSTDIR\${VERSION}\doc" 
	File doc\LICENSE.txt 
SectionEnd 
 
Section "SSWF Tools" 
	SectionIn 1 2 3 
	SetDetailsPrint both 
	DetailPrint "Installing the ScriptSWF ${VERSION} tools" 
	SetDetailsPrint listonly 
	SetOutPath "$INSTDIR\${VERSION}\bin" 
	File /oname=sswf.exe bin\sswf-static.exe 
	File /oname=ft2sswf.exe bin\ft2sswf-static.exe 
	File /oname=swf_dump.exe bin\swf_dump-static.exe 
	File /oname=jpg2swf.exe bin\jpg2swf-static.exe 
	File /oname=asc.exe bin\asc-static.exe 
	SetOutPath "$INSTDIR\${VERSION}\include\sswf" 
	File /r include\sswf\scripts 
SectionEnd 
 
Section "SSWF Samples" 
	SectionIn 1 4 
	SetDetailsPrint both 
	DetailPrint "Installing the Samples" 
	SetDetailsPrint listonly 
	SetOutPath "$INSTDIR\${VERSION}" 
	# Avoid all the unnecessary files 
	#File /r samples 
	 
SectionEnd 
 
Section "SSWF Documentation" 
	SectionIn 1 2 
	SetDetailsPrint both 
	DetailPrint "Installing the Documentation" 
	SetDetailsPrint listonly 
	SetOutPath "$INSTDIR\${VERSION}\doc" 
	File doc\*.txt 
	File /r doc\html 
	File /r doc\man 
SectionEnd 
 
Section "Development Files" 
	SectionIn 1 5 
	SetDetailsPrint both 
	DetailPrint "Installing the Development Files" 
	SetDetailsPrint listonly 
	SetOutPath "$INSTDIR\${VERSION}" 
	File /r lib 
	SetOutPath "$INSTDIR\${VERSION}\include\sswf" 
	File /r include\sswf\*.h 
SectionEnd 
 
Section "Source Code" 
	SectionIn 1 6 
	SetDetailsPrint both 
	DetailPrint "Installing the Source Code" 
	SetDetailsPrint listonly 
	# We want to avoid all these ugly files... 
	#SetOutPath "$INSTDIR\${VERSION}" 
	#File /r src 
	 
	SetOutPath "$INSTDIR\${VERSION}" 
	File /r VC 
	SetOutPath "$INSTDIR\${VERSION}\include\sswf" 
	File /r include\sswf\*.h 
SectionEnd 
 
Section "-post" 
	SectionIn 1 2 3 4 5 6 
	SetDetailsPrint listonly 
	WriteRegStr HKLM "Software\Made to Order Software, Ltd.\sswf" "InstallDir" "$INSTDIR" 
	WriteRegStr HKLM "Software\Made to Order Software, Ltd.\sswf" "Version" "${VERSION}" 
 
	# Rename the source files from c++ to cpp 
	# (it generates errors when everything isn't installed) 
	SetOutPath "$INSTDIR\${VERSION}\VC" 
	Exec "$INSTDIR\${VERSION}\VC\rename_all.bat" 
 
	SetDetailsPrint both 
	DetailPrint "Installation completed." 
	SetDetailsPrint listonly 
SectionEnd 
 
# The following will delete what this installer 
# installs (especially the registry keys!) 
Section "Uninstall" 
	SetDetailsPrint both 
	DetailPrint "Uninstalling ScriptSWF  development tools" 
	SetDetailsPrint listonly 
 
	ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" "InstallLocation" 
 
	# Instead of this message box I added the uninstConfirm page 
	#MessageBox MB_YESNO "The ScriptSWF uninstaller is ready to remove ScriptSWF from your computer.$\r$\nIf you created files in the ScriptSWF folders, they will also be removed.$\r$\nAre you sure you want to remove ScriptSWF? (We strongly recommand you don't)" IDYES confirmed 
	#Abort "Uninstallation of ScriptSWF Cancelled" 
	#confirmed: 
 
	IfFileExists $INSTDIR\sswf.exe sswf_is_installed 
		MessageBox MB_YESNO "ScriptSWF ${VERSION} doesn't seem to be installed in '$INSTDIR\sswf.exe'.$\r$\nAre you sure you want to continue?" IDYES sswf_is_installed 
		Abort "Uninstallation of ScriptSWF ${VERSION} Cancelled" 
	sswf_is_installed: 
 
	# We delete the whole folder even if the user created stuff in there! 
	RMDir /r /REBOOTOK "$0\" 
	# We leave the sswf info since we'd like to use it on next install 
	#DeleteRegKey HKLM "Software\Made to Order Software, Ltd.\sswf" 
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ScriptSWF-${VERSION}" 
SectionEnd