Cleanup of wildly obsolete files in the NSIS code.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2666 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2007-01-14 05:10:10 +00:00
parent 0f6bb27a24
commit a8bc37827b
12 changed files with 0 additions and 2507 deletions
-77
View File
@@ -1,77 +0,0 @@
Directions for building the Windows Installer.
it is required that you have cygwin with tar, gzip, 'zip', and perl installed
http://www.cygwin.org
alternatively, steps 3 and 4 can be completed on a linux machine (which
will probably work better anyway)
The following additional tools are required:
NSIS 2.0b3 or newer: nsis.sourceforge.net
Optionally:
upx 1.90 or newer: http://upx.sourceforge.net/#unstable
resource hacker: http://www.users.on.net/johnson/resourcehacker/
1) Compile uqm.exe. Note that uqmversion.h defines the version of UQM to build,
and should be set appropriately before compiling
2) Build content .zip files and content.nsh
For this procedure, you must have no modifications in the content tree.
having additional files won't cause any issues, but there can't be any
modified files.
./build_archives.pl
This will generate .zip files of the content directory (assuming
uqmversion.h defines the version as 0.3):
uqm-0.3-content.zip
uqm-0.3-voice.zip
uqm-0.3-3domusic.zip
These files should be uploaded to the distribution web page
It will also generate content.nsh which contains information about the
archives, for use in the installer
3) Modify the install script:
Edit options.nsh, and change the following variables:
DOWNLOAD_LOCATION: The default directory to download the archives from
if not using a mirror file. NOTE: This parameter
can be overridden by setting <...>_LOCATION an a
per-archive basis.
MIRROR_LOCATION: The default location of the mirror file to use for
retrieving the archives if <...>_USE_MIRROR is defined
(see below). The mirror file contains a list of
directries (http) where the data-file can be
downloaded from. NOTE: This parameter can be
overridden by setting <...>_LOCATION an a
per-archive basis.
Each of the archives can be fine-tuned using per-archive defines. For
most of these, the defaults should be fine. The only paramater that
is likely to need changing is:
<...>_USE_MIRROR: Whether to use a mirror file or not. If this
parameter is not defined then DOWNLOAD_LOCATION
will be used, ootherwise MIRROR_LOCATION will be
used. If <...>_LOCATION is defined, then
<...>_USE_MIRROR must still be set depending on
whetehr the locationn is a mirror-file or directory.
(NOTE: DO NOT set it to '0'. The value should
either be defined as '1' or not at all. Defining
it is '0' WILL break things)
The other sections that may be changed are defined below, however it is
STRONGLY recommended that you do not change them without being sure of
what you are doing!
<...>_LOCATION: The path (http) to retrieve the data-file or mirror-
file from (depending on the value of 'USE_MIRROR')
USE_UBX: This will compress uqm.exe and the installer with
ubx. This may break the game and/or installer, and
is not recomended.
MUI_VERSION: The version of UQM you are building. This parameter
is normally auto-defined by reading uqmversion.h,
but can be manually overridden if needed.
4) Run NSIS to build the installer:
makensis uqm.nsi
The installer expects all the dlls to be in the same directory as uqm.exe
5) You should be done.
-6
View File
@@ -1,6 +0,0 @@
Things still needing doing of the installer:
- Check md5 sums on downloaded files
- Read previous install directory from registry
- Allow users to choose mirror
- Only read mirror file once, if only 1 is used.
- Use uqm icon for the installer
-163
View File
@@ -1,163 +0,0 @@
#! /usr/bin/perl -w
use File::Find;
use Cwd;
# fetch the version from uqmversion.h
if (-f "../../src/uqmversion.h") {
open (FH, "../../src/uqmversion.h") or die "couldn't read uqmversion.h\n";
while (<FH>) {
if (/^\s*#define\s+UQM_MAJOR_VERSION\s+(\d+)/) {
$major = $1;
}
if (/^\s*#define\s+UQM_MINOR_VERSION\s+(\d+)/) {
$minor = $1;
}
if (/^\s*#define\s+UQM_EXTRA_VERSION\s+"(.*)"/) {
$extra = $1;
}
}
close FH;
if (!defined ($major) || !defined ($minor) || !defined ($extra)) {
die "Error reading uqmversion.h\n";
}
$version = "$major.${minor}${extra}";
} else {
die "couldn't find uqmversion.h\n";
}
@dirs = ();
@all = ();
$cwd = cwd();
chdir "../../content";
find (\&find_callback, ".");
$content_zip = "uqm-${version}-content.zip";
$voice_zip = "uqm-${version}-voice.zip";
$threedo_zip = "uqm-${version}-3domusic.zip";
open (FH, ">$cwd/content.nsh");
#print FH "!verbose 3\n";
#print FH "!macro REMOVE_CONTENT\n";
#print FH "Delete \"\$INSTDIR\\content\\packages\\$content_zip\"\n";
#print FH "Delete \"\$INSTDIR\\content\\packages\\$voice_zip\"\n";
#print FH "Delete \"\$INSTDIR\\content\\packages\\$threedo_zip\"\n";
#print FH "!macroend\n";
open FH1, ">tmpfile" || die "Couldn't create temp file!\n";
open FH2, ">tmpfile1" || die "Couldn't create temp file!\n";
open FH3, ">tmpfile2" || die "Couldn't create temp file!\n";
$content_size = 0;
$voice_size = 0;
$threedo_size = 0;
$num_voice = 0;
$num_content = 0;
$num_3do = 0;
foreach $path (@all) {
if (-f $path) {
($null,$null,$null,$null,$null,$null,$null,$siz1) = stat $path;
if ($path =~ /comm\/.*\/.*\.ogg$/) {
$voice_size += $siz1;
$num_voice++;
print FH2 "$path\n";
} elsif ($path =~ /\.ogg$/) {
$threedo_size += $siz1;
$num_3do++;
print FH3 "$path\n";
} else {
$content_size += $siz1;
$num_content++;
print FH1 "$path\n";
}
} else {
print "WARNING: '$path' was not found in local repository\n";
}
if ($path =~ /^(.*\/)([^\/]+)$/) {
$dir = $1;
@partdir = split /\//, $dir;
$newdir = "";
foreach $dir (@partdir) {
$newdir .= "/" if ($newdir);
$newdir .= "$dir";
if (! grep(m{^$newdir$}, @dirs)) {
unshift @dirs, $newdir;
}
}
}
}
close FH1;
close FH2;
close FH3;
unlink "$cwd/$content_zip";
unlink "$cwd/$voice_zip";
unlink "$cwd/$threedo_zip";
`cat tmpfile | zip -r "$cwd/$content_zip" -@`;
`cat tmpfile1 | zip -r -n .ogg "$cwd/$voice_zip" -@` if($voice_size);
`cat tmpfile2 | zip -r -n .ogg "$cwd/$threedo_zip" -@` if($threedo_size);
unlink "tmpfile";
unlink "tmpfile1";
unlink "tmpfile2";
$content_size = int(0.5 + $content_size / 1000);
$voice_size = int(0.5 + $voice_size / 1000);
$threedo_size = int(0.5 + $threedo_size / 1000);
print FH "!verbose 4\n\n";
print FH "!ifndef MUI_VERSION\n";
print FH " !define MUI_VERSION \"$version\"\n";
print FH "!endif\n";
print FH "\n";
print FH "!define CONTENT_SIZE $content_size\n";
print FH "!define VOICE_SIZE $voice_size\n";
print FH "!define THREEDO_SIZE $threedo_size\n";
print FH "\n";
print FH "!ifndef CONTENT_PACKAGE_FILE\n";
print FH " !define CONTENT_PACKAGE_FILE \"$content_zip\"\n";
print FH "!endif\n";
print FH "\n";
print FH "!ifndef VOICE_PACKAGE_FILE\n";
print FH " !define VOICE_PACKAGE_FILE \"$voice_zip\"\n";
print FH "!endif\n";
print FH "\n";
print FH "!ifndef THREEDO_PACKAGE_FILE\n";
print FH " !define THREEDO_PACKAGE_FILE \"$threedo_zip\"\n";
print FH "!endif\n";
print FH "\n";
close FH;
print "content : #files: $num_content ($content_size kb)\n";
print "voice : #files: $num_voice ($voice_size kb)\n";
print "threedo : #files: $num_3do ($threedo_size kb)\n";
exit;
##########################################
sub find_callback {
my ($file) = $File::Find::name;
my ($dir) = $File::Find::dir;
if ($dir !~ /(.*)\/CVS$/) {
return;
}
my ($root) = ($1 =~ /[^\/]*\/(.*)$/);
return if ($file !~ /Entries$/);
open FH_find, $_ or die "Can't read file '$file'\n";
while (<FH_find>) {
chomp;
my (@args) = split '/';
if (scalar (@args) >= 3 && -f "../$args[1]") {
if (defined ($root)) {
$file1 = "$root/$args[1]";
} else {
$file1 = $args[1];
}
$alldata{"$file1,head"} = $args[2];
$alldata{"$file1,prev"} = "";
push @all, $file1;
} else {
# print "Couldn't parse '$root' @args\n";
}
}
close FH_find;
}
-200
View File
@@ -1,200 +0,0 @@
!macro Print PARAM
SetDetailsPrint both
DetailPrint "${PARAM}"
SetDetailsPrint textonly
!macroend
;------------------------------------------------------------------------------
; TrimNewlines
; input, top of stack (i.e. whatever$\r$\n)
; output, top of stack (replaces, with i.e. whatever)
; modifies no other variables.
;
Function TrimNewlines
Exch $0
Push $1
Push $2
StrCpy $1 0
loop:
IntOp $1 $1 - 1
StrCpy $2 $0 1 $1
StrCmp $2 "$\r" loop
StrCmp $2 "$\n" loop
IntOp $1 $1 + 1
StrLen $2 $0
IntOp $2 $2 + $1
StrCpy $0 $0 $2
Pop $2
Pop $1
Exch $0
FunctionEnd
;------------------------------------------------------------------------------
; Download
; $0 = Package to download
; $1 = Mirror location or Download location
; $2 = Install directory
; $3 = Use mirror or direct download
Function Download
SetDetailsPrint textonly
StrCpy $R9 success
IntCmp $3 1 dl_mirror
StrCpy $R3 "$1/$0"
StrCpy $R5 0
goto download_file
dl_mirror:
!insertmacro Print $(DownloadDownloading)
!insertmacro Print $(DownloadRetrievingMirrorList)
; Save variables
Push $0
; make the call to download
GetTempFileName $R0
nsisdl::download_quiet $1 $R0 ; for a quiet install, use download_quiet
Pop $0
; check if download succeeded
StrCmp $0 "success" mirrorsuccessful
StrCmp $0 "cancel" mirrorcancelled
; we failed
!insertmacro Print $(DownloadDownloadFailed)
;Delete $R0
StrCpy $R1 $0
Pop $0
MessageBox MB_OK|MB_ICONEXCLAMATION $(DownloadMirrorDownloadFailedBox)
StrCpy $R9 failure
goto function_end
mirrorcancelled:
!insertmacro Print $(DownloadDownloadCancelled)
Delete $R0
Pop $0
StrCpy $R9 cancel
goto function_end
mirrorsuccessful:
!insertmacro Print $(DownloadRetrievingMirrorListSuccessful)
Pop $0
FileOpen $R1 $R0 a
FileRead $R1 $R5
; Check the the first line is a number
IntCmp $R5 0 mirror_broken 0 0
FileClose $R1
;Calculate a random number based on the filetime of the downloaded mirror list
GetFileTime $R0 $R7 $R2
IntOp $R2 $R2 & "16777215" ;Just keep the last few bity, also ensure that $R6 is positive
IntOp $R2 $R2 / "100" ;Skip last 2 digits, they aren't really random due to low timer resolution
IntOp $R2 $R2 % $R5
IntOp $R2 $R2 + "1" ; $R2 now contains the index of the mirror to use first
StrCpy $R8 $R2
mirrorretry:
;Now parse the mirror list
FileOpen $R1 $R0 a
;Read number of mirrors into $R5
FileRead $R1 $R5
; Check the the first line is a number
IntCmp $R5 0 mirror_broken 0 0
StrCpy $R6 $R8
StrCpy $R7 $R5
readmirror:
FileRead $R1 $R4
IntOp $R6 $R6 - "1"
IntOp $R7 $R7 - "1"
Push $R4
Call TrimNewlines
Pop $R4
IntCmp $R6 0 readmirror_random
IntCmp $R7 0 readmirror_done
goto readmirror
readmirror_random:
StrCpy $R3 "$R4/$0"
goto readmirror_done
IntCmp $R7 0 readmirror_done
goto readmirror
mirror_broken:
!insertmacro Print $(DownloadMirrorBroken)
FileClose $R1
Delete $R0
MessageBox MB_OK|MB_ICONEXCLAMATION $(DownloadMirrorBrokenDlg)
StrCpy $R9 failure
goto function_end
readmirror_done:
;$R3 now contains the mirror to use
!insertmacro Print $(DownloadUsingMirror)
FileClose $R1
;Done parsing
;Delete $R0
;Now download the file
download_file:
; Save variables
Push $0
; make the call to download
StrCpy $R7 $R0
StrCpy $R0 $2\$0
nsisdl::download $R3 $R0 ; for a quiet install, use download_quiet
Pop $0
; check if download succeeded
StrCmp $0 "success" dlsuccessful
StrCmp $0 "cancel" dlcancelled
; we failed
!insertmacro Print $(DownloadDownloadFailed)
Delete $R0
StrCpy $R0 $R7
StrCpy $R6 $0
Pop $0
IntOp $R8 $R8 + "1"
IntCmp $R8 $R5 0 0 dlmirrorwrap
dlafterwrap:
IntCmp $R8 $R2 dlfailed 0 0
goto mirrorretry
dlmirrorwrap:
StrCpy $R8 "1"
goto dlafterwrap
dlfailed:
Delete $R7
StrCpy $R1 $R6
MessageBox MB_OK|MB_ICONEXCLAMATION $(DownloadDownloadFailedBox)
StrCpy $R9 failure
goto function_end
dlcancelled:
!insertmacro Print $(DownloadDownloadCancelled)
Delete $R0
Delete $R7
Pop $0
StrCpy $R9 cancel
goto function_end
dlsuccessful:
!insertmacro Print $(DownloadDownloadSuccessful)
Delete $R7
Pop $0
function_end:
Push $R9
SetDetailsPrint both
FunctionEnd
-8
View File
@@ -1,8 +0,0 @@
7
http://easynews.dl.sourceforge.net/sourceforge/sc2
http://unc.dl.sourceforge.net/sourceforge/sc2
http://twtelecom.dl.sourceforge.net/sourceforge/sc2
http://belnet.dl.sourceforge.net/sourceforge/sc2
http://heanet.dl.sourceforge.net/sourceforge/sc2
http://telia.dl.sourceforge.net/sourceforge/sc2
http://cesnet.dl.sourceforge.net/sourceforge/sc2
-17
View File
@@ -1,17 +0,0 @@
!define DOWNLOAD_LOCATION "http://sc2.sourceforge.net/install_files/0.3"
!define MIRROR_LOCATION "http://sc2.sourceforge.net/install_files/0.3/mirrors.txt"
!define CONTENT_USE_MIRROR 1 ; Define if the download should use a mirror
!define VOICE_USE_MIRROR 1 ; Define if the download should use a mirror
!define THREEDO_USE_MIRROR 1 ; Define if the download should use a mirror
; -----------------------------
; Only define these if you need fine control over where the archives are stored
;!define CONTENT_LOCATION "http://sc2.sourceforge.net/install_files/0.3/mirror.txt"
;!define VOICE_LOCATION "http://sc2.sourceforge.net/install_files/0.3"
;!define THREEDO_LOCATION "http://sc2.sourceforge.net/install_files/0.3/mirror.txt"
; -----------------------------
; using 'ubx' is risky, and often leads to unusable binaries. I don't
; recommend enabling it
; !define USE_UBX
-500
View File
@@ -1,500 +0,0 @@
; Script generated by the HM NIS Edit Script Wizard.
Var PACKAGEDIR
Var UQMARGS
Var MAKEICON
Var UQMUSERDATA
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "The Ur-Quan Masters"
!define PRODUCT_VERSION "0.4.0"
!define PRODUCT_WEB_SITE "http://sc2.sourceforge.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\uqm.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_BUTTON "Install"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "Press the Install button to continue."
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Package Dictory
!define MUI_PAGE_HEADER_TEXT "Choose Package Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder that holds packages that have already been downloaded."
!define MUI_DIRECTORYPAGE_TEXT_TOP "Setup will look for already-downloaded content packages in the following folder. To copy them from a different folder, click Browse and select another folder. If you are doing a net install, leave this field alone. Click Next to continue."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Source Folder"
!define MUI_DIRECTORYPAGE_VARIABLE $PACKAGEDIR
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Games\The Ur-Quan Masters"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_RUN "$INSTDIR\uqm.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS $UQMARGS
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "uqm-0.4.0-installer.exe"
InstallDir "$PROGRAMFILES\The Ur-Quan Masters\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
AllowRootDirInstall true
DirText "" "" "" "Please select a folder."
InstType "Typical"
InstType "Minimal"
InstType "Complete"
InstType "No Content"
Function .onInit
Push $0
StrCpy $PACKAGEDIR $EXEDIR
StrCpy $UQMARGS ""
StrCpy $MAKEICON 0
ReadEnvStr $0 APPDATA
StrCmp $0 "" NoAppData
ExpandEnvStrings $UQMUSERDATA "%APPDATA%\uqm"
Goto GotAppData
NoAppData:
ReadEnvStr $0 USERPROFILE
StrCmp $0 "" NoProfile
ExpandEnvStrings $UQMUSERDATA "%USERPROFILE%\Application Data\uqm"
Goto GotAppData
NoProfile:
StrCpy $UQMUSERDATA "$INSTDIR\userdata\uqm"
GotAppData:
FunctionEnd
Function Random
Exch $0
Push $1
System::Call 'kernel32::QueryPerformanceCounter(*l.r1)'
System::Int64Op $1 % $0
Pop $0
Pop $1
Exch $0
FunctionEnd
Function RandomServer
Push $0
Push 13
Call Random
Pop $0
IntCmp $0 0 0 +4 +4
StrCpy $0 "mesh"
Exch $0
Return
IntCmp $0 1 0 +4 +4
StrCpy $0 "cogent"
Exch $0
Return
IntCmp $0 2 0 +4 +4
StrCpy $0 "nchc"
Exch $0
Return
IntCmp $0 3 0 +4 +4
StrCpy $0 "optusnet"
Exch $0
Return
IntCmp $0 4 0 +4 +4
StrCpy $0 "heanet"
Exch $0
Return
IntCmp $0 5 0 +4 +4
StrCpy $0 "ovh"
Exch $0
Return
IntCmp $0 6 0 +4 +4
StrCpy $0 "switch"
Exch $0
Return
IntCmp $0 7 0 +4 +4
StrCpy $0 "puzzle"
Exch $0
Return
IntCmp $0 8 0 +4 +4
StrCpy $0 "kent"
Exch $0
Return
IntCmp $0 9 0 +4 +4
StrCpy $0 "belnet"
Exch $0
Return
IntCmp $0 10 0 +4 +4
StrCpy $0 "easynews"
Exch $0
Return
IntCmp $0 11 0 +4 +4
StrCpy $0 "citkit"
Exch $0
Return
StrCpy $0 "jaist"
Exch $0
FunctionEnd
# To use:
# Push the file name.
# Push the installation location.
# It will install it from the Package Directory if necessary; otherwise it
# will download it to a temp file and install that.
Var DOWNLOADTARGET
Var MANDATORY
Var MD5SUM
Function HandlePackage
Exch $0 # File location
Exch
Exch $1 # File name
Exch
Push $2
Push $3
# Check to make sure the file wasn't already installed
IfFileExists "$0\$1" 0 NotThere
md5dll::GetFileMD5 "$0\$1"
Pop $3
StrCmp $MD5SUM $3 0 NotThere
MessageBox MB_ICONINFORMATION|MB_OK "The package $1 has already been installed."
Goto PackageDone
NotThere:
SetOutPath "$0"
SetOverwrite ifdiff
IfFileExists "$PACKAGEDIR\$1" 0 AttemptDownload
md5dll::GetFileMD5 "$PACKAGEDIR\$1"
Pop $3
StrCmp $MD5SUM $3 PackageOK
MessageBox MB_ICONINFORMATION|MB_OKCANCEL "The file $PACKAGEDIR\$1 appears to be corrupt. The expected MD5 sum was '$MD5SUM', but the actual MD5 sum was '$3'. Press OK to attempt to download a fresh copy from the distribution site, or Cancel to skip the package." IDOK AttemptDownload IDCANCEL PackageDone
PackageOK:
CopyFiles "$PACKAGEDIR\$1" "$0\$1"
Goto PackageDone
AttemptDownload:
Call RandomServer
Pop $2
GetTempFileName $DOWNLOADTARGET
Delete $DOWNLOADTARGET
CreateDirectory $DOWNLOADTARGET
NSISdl::download "http://$2.dl.sourceforge.net/sourceforge/sc2/$1" "$DOWNLOADTARGET\$1"
Pop $2
StrCmp $2 "success" DownloadSuccessful
StrCmp $2 "cancel" DownloadCanceled
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
Goto CheckMandatory
DownloadCanceled:
StrCpy $2 "Download was canceled by user."
CheckMandatory:
IntCmp $MANDATORY 0 NotMandatory
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError
NotMandatory:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$2 $3 Do you want to retry from a different mirror?" IDYES AttemptDownload
Goto DoneWithTempFile
DownloadSuccessful:
md5dll::GetFileMD5 "$DOWNLOADTARGET\$1"
Pop $3
StrCmp $MD5SUM $3 DownloadedPackageOK
IntCmp $MANDATORY 0 NotMandatory2
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError2
NotMandatory2:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError2:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "The downloaded file $1 doesn't match the internal MD5 sum. This probably means the download was corrupt. $3 Do you want to retry from a different mirror? (Select NO to install the downloaded package anyway - for instance, if you know that the content pack was upgraded or modified since.)" IDYES AttemptDownload
DownloadedPackageOK:
CopyFiles "$DOWNLOADTARGET\$1" "$0\$1"
DoneWithTempFile:
RmDir /r $DOWNLOADTARGET
PackageDone:
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
SectionGroup "!UQM" SECGRP01
Section "Executable" SEC01
SectionIn 1 2 3 4 RO
SetOutPath "$INSTDIR"
SetOverwrite try
File "AUTHORS.txt"
File "COPYING.txt"
File "jpeg.dll"
File "libpng13.dll"
File "Manual.txt"
File "ogg.dll"
File "OpenAL32.dll"
File "README.txt"
File "SDL.dll"
File "SDL_image.dll"
File "uqm.exe"
File "vorbis.dll"
File "vorbisfile.dll"
File "WhatsNew.txt"
File "zlib1.dll"
SetOverwrite off
SetOutPath $UQMUSERDATA
File "keys.cfg"
IfFileExists "$INSTDIR\content\packages\uqm-0.3-3domusic.zip" 0 No03Content
StrCpy $MD5SUM "9073251b0d96393441f0b40016010576"
md5dll::GetFileMD5 "$INSTDIR\content\packages\uqm-0.3-3domusic.zip"
Pop $0
StrCmp $MD5SUM $0 0 No03Content
CopyFiles "$INSTDIR\content\packages\uqm-0.3-3domusic.zip" "$INSTDIR\content\packages\uqm-0.4.0-3domusic.uqm"
No03Content:
Delete "$INSTDIR\content\packages\uqm-0.3-3domusic.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-voice.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-content.zip"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Core Data" SEC02
SectionIn 1 2 3
CreateDirectory "$INSTDIR\content\packages\addons"
SetOutPath "$INSTDIR\content"
SetOverwrite ifnewer
AddSize 12261
StrCpy $MANDATORY 1
StrCpy $MD5SUM "f8daed517466d68805393e02a12fd642"
File "content\version"
Push "uqm-0.4.0-content.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Desktop Icon" SECICON
SectionIn 1 2 3 4
StrCpy $MAKEICON 1
SectionEnd
SectionGroupEnd
SectionGroup /e "3DO Content" SECGRP02
Section "Music" SEC03
SectionIn 1 3
AddSize 18536
StrCpy $MANDATORY 0
StrCpy $MD5SUM "9073251b0d96393441f0b40016010576"
Push "uqm-0.4.0-3domusic.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Voiceovers" SEC04
SectionIn 1 3
AddSize 112291
StrCpy $MANDATORY 0
StrCpy $MD5SUM "52a084cfaa0bc7fcc63a295feb8cbd28"
Push "uqm-0.4.0-voice.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
SectionGroupEnd
SectionGroup "Modern Remixes" SECGRP03
Section "Pack 1" SEC05
SectionIn 3
AddSize 49012
StrCpy $MANDATORY 0
StrCpy $MD5SUM "2df402b2951c0187604a81c3997fbb9d"
Push "uqm-remix-pack1.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 2" SEC06
SectionIn 3
AddSize 58869
StrCpy $MANDATORY 0
StrCpy $MD5SUM "d5a9fb72b369bf5a5dbca3db9f1e1ea3"
Push "uqm-remix-pack2.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 3" SEC07
SectionIn 3
AddSize 38989
StrCpy $MANDATORY 0
StrCpy $MD5SUM "567bc2d9e3ca067d21170c5ac5538441"
Push "uqm-remix-pack3.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
# Section "Pack 4" SEC08
# SectionIn 3
# AddSize 50000 # ESTIMATE: Update later
# StrCpy $MANDATORY 0
# Push "uqm-remix-pack4.zip"
# Push "$INSTDIR\content\packages\addons\remix\"
# Call HandlePackage
# StrCpy $UQMARGS "--addon remix"
# ; Shortcuts
# !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
# !insertmacro MUI_STARTMENU_WRITE_END
# SectionEnd
SectionGroupEnd
Section -ShortcutsAndIcons
SetOutPath $INSTDIR
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk" "$INSTDIR\Manual.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk" "$INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk" "$INSTDIR\WhatsNew.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk" "$WINDIR\notepad" "$UQMUSERDATA\keys.cfg"
IntCmp $MAKEICON 1 0 NoIcon NoIcon
CreateShortCut "$DESKTOP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
NoIcon:
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP01} "The core executables and content libraries for The Ur-Quan Masters. All elements in this section must be installed for the game to be playable."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Includes the main program, all subsidiary libraries, and basic documentation for The Ur-Quan Masters. Required for play."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Graphics, sound, and the PC-edition music for The Ur-Quan Masters. Required for play. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECICON} "Adds a desktop icon linking directly to The Ur-Quan Masters."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP02} "Optional content packages containing music and sound unique to the 1993 3DO release."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Optional package which includes the remixed songs from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional package containing the voiceovers from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP03} "Optional content packages containing the official UQM remixes by The Precursors. Selecting any element from this group will also enable the 'remix' addon by default in any shortcuts."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} `Ur-Quan Masters Remix Pack 1 - 'Super Melee!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} `Ur-Quan Masters Remix Pack 2 - 'Neutral Aliens - Don't Shoot!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} `Ur-Quan Masters Remix Pack 3 - 'The Ur-Quan Hierarchy.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
# !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} `Ur-Quan Masters Remix Pack 4 - 'The Alliance of Free Stars.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack4.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack3.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack2.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack1.zip"
Delete "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-content.uqm"
Delete "$INSTDIR\content\version"
Delete "$INSTDIR\zlib.dll"
Delete "$INSTDIR\zlib1.dll"
Delete "$INSTDIR\WhatsNew.txt"
Delete "$INSTDIR\vorbisfile.dll"
Delete "$INSTDIR\vorbis.dll"
Delete "$INSTDIR\uqm.exe"
Delete "$INSTDIR\SDL_image.dll"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\README.txt"
Delete "$INSTDIR\OpenAL32.dll"
Delete "$INSTDIR\ogg.dll"
Delete "$INSTDIR\Manual.txt"
Delete "$INSTDIR\libpng13.dll"
Delete "$INSTDIR\jpeg.dll"
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\AUTHORS.txt"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk"
Delete "$DESKTOP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP\Documentation"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\content\packages\addons\remix"
RMDir "$INSTDIR\content\packages\addons"
RMDir "$INSTDIR\content\packages"
RMDir "$INSTDIR\content"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
-544
View File
@@ -1,544 +0,0 @@
; Script generated by the HM NIS Edit Script Wizard.
Var PACKAGEDIR
Var UQMARGS
Var MAKEICON
Var UQMUSERDATA
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "The Ur-Quan Masters"
!define PRODUCT_VERSION "0.5.0"
!define PRODUCT_WEB_SITE "http://sc2.sourceforge.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\uqm.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_BUTTON "Install"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "Press the Install button to continue."
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Components page
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "You can preconfigure the options to mimic the original platforms by selecting those install types. Note that more complete installs will need to download more packages."
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Package Dictory
!define MUI_PAGE_HEADER_TEXT "Choose Package Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder that holds packages that have already been downloaded."
!define MUI_DIRECTORYPAGE_TEXT_TOP "Setup will look for already-downloaded content packages in the following folder. To copy them from a different folder, click Browse and select another folder. If you are doing a net install, leave this field alone. Click Next to continue."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Source Folder"
!define MUI_DIRECTORYPAGE_VARIABLE $PACKAGEDIR
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Games\The Ur-Quan Masters"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_RUN "$INSTDIR\uqm.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS $UQMARGS
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!define MUI_UNCONFIRMPAGE_TEXT_TOP "This program will now uninstall The Ur-Quan Masters entirely. If you wish to preserve content or expansion packs, select Cancel now and back them up. Otherwise, press Uninstall to continue."
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "uqm-0.5.0-installer.exe"
InstallDir "$PROGRAMFILES\The Ur-Quan Masters\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
AllowRootDirInstall true
DirText "" "" "" "Please select a folder."
InstType "Typical"
InstType "Minimal"
InstType "Mimic PC"
InstType "Mimic 3DO"
InstType "No Content"
InstType "All Expansions"
Function .onInit
Push $0
StrCpy $PACKAGEDIR $EXEDIR
StrCpy $UQMARGS ""
StrCpy $MAKEICON 0
ReadEnvStr $0 APPDATA
StrCmp $0 "" NoAppData
ExpandEnvStrings $UQMUSERDATA "%APPDATA%\uqm"
Goto GotAppData
NoAppData:
ReadEnvStr $0 USERPROFILE
StrCmp $0 "" NoProfile
ExpandEnvStrings $UQMUSERDATA "%USERPROFILE%\Application Data\uqm"
Goto GotAppData
NoProfile:
StrCpy $UQMUSERDATA "$INSTDIR\userdata\uqm"
GotAppData:
FunctionEnd
Function Random
Exch $0
Push $1
System::Call 'kernel32::QueryPerformanceCounter(*l.r1)'
System::Int64Op $1 % $0
Pop $0
Pop $1
Exch $0
FunctionEnd
Function RandomServer
Push $0
Push 15
Call Random
Pop $0
IntCmp $0 0 0 +4 +4
StrCpy $0 "ovh"
Exch $0
Return
IntCmp $0 1 0 +4 +4
StrCpy $0 "mesh"
Exch $0
Return
IntCmp $0 2 0 +4 +4
StrCpy $0 "easynews"
Exch $0
Return
IntCmp $0 3 0 +4 +4
StrCpy $0 "switch"
Exch $0
Return
IntCmp $0 4 0 +4 +4
StrCpy $0 "keihanna"
Exch $0
Return
IntCmp $0 5 0 +4 +4
StrCpy $0 "jaist"
Exch $0
Return
IntCmp $0 6 0 +4 +4
StrCpy $0 "ufpr"
Exch $0
Return
IntCmp $0 7 0 +4 +4
StrCpy $0 "heanet"
Exch $0
Return
IntCmp $0 8 0 +4 +4
StrCpy $0 "puzzle"
Exch $0
Return
IntCmp $0 9 0 +4 +4
StrCpy $0 "internap"
Exch $0
Return
IntCmp $0 10 0 +4 +4
StrCpy $0 "optusnet"
Exch $0
Return
IntCmp $0 11 0 +4 +4
StrCpy $0 "surfnet"
Exch $0
Return
IntCmp $0 12 0 +4 +4
StrCpy $0 "citkit"
Exch $0
Return
IntCmp $0 13 0 +4 +4
StrCpy $0 "kent"
Exch $0
Return
IntCmp $0 14 0 +4 +4
StrCpy $0 "nchc"
Exch $0
Return
StrCpy $0 "peterhost"
Exch $0
FunctionEnd
# To use:
# Push the file name.
# Push the installation location.
# It will install it from the Package Directory if necessary; otherwise it
# will download it to a temp file and install that.
Var DOWNLOADTARGET
Var MANDATORY
Var MD5SUM
Function HandlePackage
Exch $0 # File location
Exch
Exch $1 # File name
Exch
Push $2
Push $3
# Check to make sure the file wasn't already installed
IfFileExists "$0\$1" 0 NotThere
md5dll::GetFileMD5 "$0\$1"
Pop $3
StrCmp $MD5SUM $3 0 NotThere
MessageBox MB_ICONINFORMATION|MB_OK "The package $1 has already been installed."
Goto PackageDone
NotThere:
SetOutPath "$0"
SetOverwrite ifdiff
IfFileExists "$PACKAGEDIR\$1" 0 AttemptDownload
md5dll::GetFileMD5 "$PACKAGEDIR\$1"
Pop $3
StrCmp $MD5SUM $3 PackageOK
MessageBox MB_ICONINFORMATION|MB_OKCANCEL "The file $PACKAGEDIR\$1 appears to be corrupt. The expected MD5 sum was '$MD5SUM', but the actual MD5 sum was '$3'. Press OK to attempt to download a fresh copy from the distribution site, or Cancel to skip the package." IDOK AttemptDownload IDCANCEL PackageDone
PackageOK:
CopyFiles "$PACKAGEDIR\$1" "$0\$1"
Goto PackageDone
AttemptDownload:
Call RandomServer
Pop $2
GetTempFileName $DOWNLOADTARGET
Delete $DOWNLOADTARGET
CreateDirectory $DOWNLOADTARGET
NSISdl::download "http://$2.dl.sourceforge.net/sourceforge/sc2/$1" "$DOWNLOADTARGET\$1"
Pop $2
StrCmp $2 "success" DownloadSuccessful
StrCmp $2 "cancel" DownloadCanceled
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
Goto CheckMandatory
DownloadCanceled:
StrCpy $2 "Download was canceled by user."
CheckMandatory:
IntCmp $MANDATORY 0 NotMandatory
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError
NotMandatory:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$2 $3 Do you want to retry from a different mirror?" IDYES AttemptDownload
Goto DoneWithTempFile
DownloadSuccessful:
md5dll::GetFileMD5 "$DOWNLOADTARGET\$1"
Pop $3
StrCmp $MD5SUM $3 DownloadedPackageOK
IntCmp $MANDATORY 0 NotMandatory2
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError2
NotMandatory2:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError2:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "The downloaded file $1 doesn't match the internal MD5 sum. This probably means the download was corrupt. $3 Do you want to retry from a different mirror? (Select NO to install the downloaded package anyway - for instance, if you know that the content pack was upgraded or modified since.)" IDYES AttemptDownload
DownloadedPackageOK:
CopyFiles "$DOWNLOADTARGET\$1" "$0\$1"
DoneWithTempFile:
RmDir /r $DOWNLOADTARGET
PackageDone:
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
SectionGroup "!UQM" SECGRP01
Section "Executable" SEC01
SectionIn 1 2 3 4 5 6 RO
SetOutPath "$INSTDIR"
SetOverwrite try
File "AUTHORS.txt"
File "COPYING.txt"
File "jpeg.dll"
File "libpng13.dll"
File "Manual.txt"
File "ogg.dll"
File "OpenAL32.dll"
File "README.txt"
File "SDL.dll"
File "SDL_image.dll"
File "uqm.exe"
File "vorbis.dll"
File "vorbisfile.dll"
File "WhatsNew.txt"
File "zlib1.dll"
SetOverwrite off
SetOutPath $UQMUSERDATA
File "keys.cfg"
File "uqm.cfg"
SetOverwrite try
File "uqm-pc.cfg"
File "uqm-3do.cfg"
IfFileExists "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm" 0 DelOldContent
StrCpy $MD5SUM "52a084cfaa0bc7fcc63a295feb8cbd28"
md5dll::GetFileMD5 "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm"
Pop $0
StrCmp $MD5SUM $0 0 DelOldContent
CopyFiles "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm" "$INSTDIR\content\packages\uqm-0.5.0-voice.uqm"
DelOldContent:
Delete "$INSTDIR\content\packages\uqm-0.3-3domusic.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-voice.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-content.zip"
Delete "$INSTDIR\content\packages\uqm-0.4.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-content.uqm"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Core Data" SEC02
SectionIn 1 2 3 4 6
CreateDirectory "$INSTDIR\content\packages\addons"
SetOutPath "$INSTDIR\content"
SetOverwrite ifnewer
AddSize 12261
StrCpy $MANDATORY 1
StrCpy $MD5SUM "1d03864b141a2626a7284bc7cfdefb47"
File "content\version"
Push "uqm-0.5.0-content.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Desktop Icon" SECICON
SectionIn 1 2 3 4 5 6
StrCpy $MAKEICON 1
SectionEnd
SectionGroupEnd
SectionGroup /e "3DO Content" SECGRP02
Section "Music" SEC03
SectionIn 1 4 6
AddSize 18536
StrCpy $MANDATORY 0
StrCpy $MD5SUM "a20cacc8e66f5ff1fdf5e1d3a3b93fd2"
Push "uqm-0.5.0-3domusic.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Voiceovers" SEC04
SectionIn 1 4 6
AddSize 112291
StrCpy $MANDATORY 0
StrCpy $MD5SUM "52a084cfaa0bc7fcc63a295feb8cbd28"
Push "uqm-0.5.0-voice.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
SectionGroupEnd
SectionGroup "Modern Remixes" SECGRP03
Section "Pack 1" SEC05
SectionIn 6
AddSize 49012
StrCpy $MANDATORY 0
StrCpy $MD5SUM "2df402b2951c0187604a81c3997fbb9d"
Push "uqm-remix-pack1.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 2" SEC06
SectionIn 6
AddSize 58869
StrCpy $MANDATORY 0
StrCpy $MD5SUM "d5a9fb72b369bf5a5dbca3db9f1e1ea3"
Push "uqm-remix-pack2.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 3" SEC07
SectionIn 6
AddSize 38989
StrCpy $MANDATORY 0
StrCpy $MD5SUM "567bc2d9e3ca067d21170c5ac5538441"
Push "uqm-remix-pack3.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
# Section "Pack 4" SEC08
# SectionIn 6
# AddSize 50000 # ESTIMATE: Update later
# StrCpy $MANDATORY 0
# Push "uqm-remix-pack4.zip"
# Push "$INSTDIR\content\packages\addons\remix\"
# Call HandlePackage
# StrCpy $UQMARGS "--addon remix"
# ; Shortcuts
# !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
# !insertmacro MUI_STARTMENU_WRITE_END
# SectionEnd
SectionGroupEnd
Section -ShortcutsAndIcons
SetOutPath $INSTDIR
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk" "$INSTDIR\Manual.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk" "$INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk" "$INSTDIR\WhatsNew.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk" "$WINDIR\notepad" "$UQMUSERDATA\keys.cfg"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Options Configuration.lnk" "$WINDIR\notepad" "$UQMUSERDATA\uqm.cfg"
IntCmp $MAKEICON 1 0 NoIcon NoIcon
CreateShortCut "$DESKTOP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
NoIcon:
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Set3DOConfig
SectionIn 4
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $UQMUSERDATA
Delete "uqm.cfg"
CopyFiles "$UQMUSERDATA\uqm-3do.cfg" "$UQMUSERDATA\uqm.cfg"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -SetPCConfig
SectionIn 3
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $UQMUSERDATA
Delete "uqm.cfg"
CopyFiles "$UQMUSERDATA\uqm-pc.cfg" "$UQMUSERDATA\uqm.cfg"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP01} "The core executables and content libraries for The Ur-Quan Masters. All elements in this section must be installed for the game to be playable."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Includes the main program, all subsidiary libraries, and basic documentation for The Ur-Quan Masters. Required for play."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Graphics, sound, and the PC-edition music for The Ur-Quan Masters. Required for play. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECICON} "Adds a desktop icon linking directly to The Ur-Quan Masters."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP02} "Optional content packages containing music and sound unique to the 1993 3DO release."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Optional package which includes the remixed songs from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional package containing the voiceovers from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP03} "Optional content packages containing the official UQM remixes by The Precursors. Selecting any element from this group will also enable the 'remix' addon by default in any shortcuts."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} `Ur-Quan Masters Remix Pack 1 - 'Super Melee!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} `Ur-Quan Masters Remix Pack 2 - 'Neutral Aliens - Don't Shoot!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} `Ur-Quan Masters Remix Pack 3 - 'The Ur-Quan Hierarchy.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
# !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} `Ur-Quan Masters Remix Pack 4 - 'The New Alliance of Free Stars.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack4.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack3.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack2.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack1.zip"
Delete "$INSTDIR\content\packages\uqm-0.5.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.5.0-content.uqm"
Delete "$INSTDIR\content\version"
Delete "$INSTDIR\zlib.dll"
Delete "$INSTDIR\zlib1.dll"
Delete "$INSTDIR\WhatsNew.txt"
Delete "$INSTDIR\vorbisfile.dll"
Delete "$INSTDIR\vorbis.dll"
Delete "$INSTDIR\uqm.exe"
Delete "$INSTDIR\SDL_image.dll"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\README.txt"
Delete "$INSTDIR\OpenAL32.dll"
Delete "$INSTDIR\ogg.dll"
Delete "$INSTDIR\Manual.txt"
Delete "$INSTDIR\libpng13.dll"
Delete "$INSTDIR\jpeg.dll"
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\AUTHORS.txt"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Options Configuration.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk"
Delete "$DESKTOP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP\Documentation"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\content\packages\addons\remix"
RMDir "$INSTDIR\content\packages\addons"
RMDir "$INSTDIR\content\packages"
RMDir "$INSTDIR\content"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
-559
View File
@@ -1,559 +0,0 @@
; Script generated by the HM NIS Edit Script Wizard.
Var PACKAGEDIR
Var UQMARGS
Var MAKEICON
Var UQMUSERDATA
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "The Ur-Quan Masters"
!define PRODUCT_VERSION "0.6.0"
!define PRODUCT_WEB_SITE "http://sc2.sourceforge.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\uqm.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "orzshofixti.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "ultron.bmp"
!define MUI_HEADERIMAGE_RIGHT
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_LICENSEPAGE_BUTTON "Install"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "Press the Install button to continue."
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Components page
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "You can preconfigure the options to mimic the original platforms by selecting those install types. Note that more complete installs will need to download more packages."
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Package Dictory
!define MUI_PAGE_HEADER_TEXT "Choose Package Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder that holds packages that have already been downloaded."
!define MUI_DIRECTORYPAGE_TEXT_TOP "Setup will look for already-downloaded content packages in the following folder. To copy them from a different folder, click Browse and select another folder. If you are doing a net install, leave this field alone. Click Next to continue."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Source Folder"
!define MUI_DIRECTORYPAGE_VARIABLE $PACKAGEDIR
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Games\The Ur-Quan Masters"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_RUN "$INSTDIR\uqm.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS $UQMARGS
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!define MUI_UNCONFIRMPAGE_TEXT_TOP "This program will now uninstall The Ur-Quan Masters entirely. If you wish to preserve content or expansion packs, select Cancel now and back them up. Otherwise, press Uninstall to continue."
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "uqm-0.6.0-installer.exe"
InstallDir "$PROGRAMFILES\The Ur-Quan Masters\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
AllowRootDirInstall true
DirText "" "" "" "Please select a folder."
InstType "Typical"
InstType "Minimal"
InstType "Mimic PC"
InstType "Mimic 3DO"
InstType "No Content"
InstType "All Expansions"
Function .onInit
Push $0
StrCpy $PACKAGEDIR $EXEDIR
StrCpy $UQMARGS ""
StrCpy $MAKEICON 0
ReadEnvStr $0 APPDATA
StrCmp $0 "" NoAppData
ExpandEnvStrings $UQMUSERDATA "%APPDATA%\uqm"
Goto GotAppData
NoAppData:
ReadEnvStr $0 USERPROFILE
StrCmp $0 "" NoProfile
ExpandEnvStrings $UQMUSERDATA "%USERPROFILE%\Application Data\uqm"
Goto GotAppData
NoProfile:
StrCpy $UQMUSERDATA "$INSTDIR\userdata\uqm"
GotAppData:
FunctionEnd
Function Random
Exch $0
Push $1
System::Call 'kernel32::QueryPerformanceCounter(*l.r1)'
System::Int64Op $1 % $0
Pop $0
Pop $1
Exch $0
FunctionEnd
Function RandomServer
Push $0
Push 15
Call Random
Pop $0
IntCmp $0 0 0 +4 +4
StrCpy $0 "ovh"
Exch $0
Return
IntCmp $0 1 0 +4 +4
StrCpy $0 "mesh"
Exch $0
Return
IntCmp $0 2 0 +4 +4
StrCpy $0 "easynews"
Exch $0
Return
IntCmp $0 3 0 +4 +4
StrCpy $0 "switch"
Exch $0
Return
IntCmp $0 4 0 +4 +4
StrCpy $0 "superb-east"
Exch $0
Return
IntCmp $0 5 0 +4 +4
StrCpy $0 "jaist"
Exch $0
Return
IntCmp $0 6 0 +4 +4
StrCpy $0 "ufpr"
Exch $0
Return
IntCmp $0 7 0 +4 +4
StrCpy $0 "heanet"
Exch $0
Return
IntCmp $0 8 0 +4 +4
StrCpy $0 "puzzle"
Exch $0
Return
IntCmp $0 9 0 +4 +4
StrCpy $0 "superb-west"
Exch $0
Return
IntCmp $0 10 0 +4 +4
StrCpy $0 "optusnet"
Exch $0
Return
IntCmp $0 11 0 +4 +4
StrCpy $0 "surfnet"
Exch $0
Return
IntCmp $0 12 0 +4 +4
StrCpy $0 "belnet"
Exch $0
Return
IntCmp $0 13 0 +4 +4
StrCpy $0 "kent"
Exch $0
Return
IntCmp $0 14 0 +4 +4
StrCpy $0 "nchc"
Exch $0
Return
StrCpy $0 "umn"
Exch $0
FunctionEnd
# To use:
# Push the file name.
# Push the installation location.
# It will install it from the Package Directory if necessary; otherwise it
# will download it to a temp file and install that.
Var DOWNLOADTARGET
Var MANDATORY
Var MD5SUM
Function HandlePackage
Exch $0 # File location
Exch
Exch $1 # File name
Exch
Push $2
Push $3
# Check to make sure the file wasn't already installed
IfFileExists "$0\$1" 0 NotThere
md5dll::GetFileMD5 "$0\$1"
Pop $3
StrCmp $MD5SUM $3 0 NotThere
MessageBox MB_ICONINFORMATION|MB_OK "The package $1 has already been installed."
Goto PackageDone
NotThere:
SetOutPath "$0"
SetOverwrite ifdiff
IfFileExists "$PACKAGEDIR\$1" 0 AttemptDownload
md5dll::GetFileMD5 "$PACKAGEDIR\$1"
Pop $3
StrCmp $MD5SUM $3 PackageOK
MessageBox MB_ICONINFORMATION|MB_OKCANCEL "The file $PACKAGEDIR\$1 appears to be corrupt. The expected MD5 sum was '$MD5SUM', but the actual MD5 sum was '$3'. Press OK to attempt to download a fresh copy from the distribution site, or Cancel to skip the package." IDOK AttemptDownload IDCANCEL PackageDone
PackageOK:
CopyFiles "$PACKAGEDIR\$1" "$0\$1"
Goto PackageDone
AttemptDownload:
Call RandomServer
Pop $2
GetTempFileName $DOWNLOADTARGET
Delete $DOWNLOADTARGET
CreateDirectory $DOWNLOADTARGET
NSISdl::download "http://$2.dl.sourceforge.net/sourceforge/sc2/$1" "$DOWNLOADTARGET\$1"
Pop $2
StrCmp $2 "success" DownloadSuccessful
StrCmp $2 "cancel" DownloadCanceled
StrCpy $2 "Could not install the package $1 due to the following error: $\"$2$\"."
Goto CheckMandatory
DownloadCanceled:
StrCpy $2 "Download was canceled by user."
CheckMandatory:
IntCmp $MANDATORY 0 NotMandatory
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError
NotMandatory:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$2 $3 Do you want to retry from a different mirror?" IDYES AttemptDownload
Goto DoneWithTempFile
DownloadSuccessful:
md5dll::GetFileMD5 "$DOWNLOADTARGET\$1"
Pop $3
StrCmp $MD5SUM $3 DownloadedPackageOK
IntCmp $MANDATORY 0 NotMandatory2
StrCpy $3 "THIS IS A MANDATORY PACKAGE. Without this package, $(^Name) will NOT run."
Goto DisplayError2
NotMandatory2:
StrCpy $3 "This is an optional package. $(^Name) will still run, but some content will not be available."
DisplayError2:
MessageBox MB_ICONEXCLAMATION|MB_YESNO "The downloaded file $1 doesn't match the internal MD5 sum. This probably means the download was corrupt. $3 Do you want to retry from a different mirror? (Select NO to install the downloaded package anyway - for instance, if you know that the content pack was upgraded or modified since.)" IDYES AttemptDownload
DownloadedPackageOK:
CopyFiles "$DOWNLOADTARGET\$1" "$0\$1"
DoneWithTempFile:
RmDir /r $DOWNLOADTARGET
PackageDone:
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
SectionGroup "!UQM" SECGRP01
Section "Executable" SEC01
SectionIn 1 2 3 4 5 6 RO
SetOutPath "$INSTDIR"
SetOverwrite try
File "AUTHORS.txt"
File "COPYING.txt"
File "libpng12.dll"
File "Manual.txt"
File "ogg.dll"
File "OpenAL32.dll"
File "README.txt"
File "SDL.dll"
File "SDL_image.dll"
File "SDL_gfx.dll"
File "uqm.exe"
File "keyjam.exe"
File "vorbis.dll"
File "vorbisfile.dll"
File "WhatsNew.txt"
File "zlib1.dll"
SetOverwrite off
SetOutPath $UQMUSERDATA
File "keys.cfg"
File "uqm.cfg"
SetOverwrite try
File "uqm-pc.cfg"
File "uqm-3do.cfg"
IfFileExists "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" 0 DelOldContent
StrCpy $MD5SUM "a20cacc8e66f5ff1fdf5e1d3a3b93fd2"
md5dll::GetFileMD5 "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm"
Pop $0
StrCmp $MD5SUM $0 0 DelOldContent
CopyFiles "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm" "$INSTDIR\content\packages\uqm-0.6.0-3domusic.uqm"
DelOldContent:
Delete "$INSTDIR\content\packages\uqm-0.3-3domusic.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-voice.zip"
Delete "$INSTDIR\content\packages\uqm-0.3-content.zip"
Delete "$INSTDIR\content\packages\uqm-0.4.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.4.0-content.uqm"
Delete "$INSTDIR\content\packages\uqm-0.5.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.5.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.5.0-content.uqm"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Core Data" SEC02
SectionIn 1 2 3 4 6
CreateDirectory "$INSTDIR\content\packages\addons"
SetOutPath "$INSTDIR\content"
SetOverwrite ifnewer
AddSize 12261
StrCpy $MANDATORY 1
StrCpy $MD5SUM "7e8f0ed8490e24231431420ea2ba6a03"
File "content\version"
Push "uqm-0.6.0-content.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Desktop Icon" SECICON
SectionIn 1 2 3 4 5 6
StrCpy $MAKEICON 1
SectionEnd
SectionGroupEnd
SectionGroup /e "3DO Content" SECGRP02
Section "Music" SEC03
SectionIn 1 4 6
AddSize 18536
StrCpy $MANDATORY 0
StrCpy $MD5SUM "a20cacc8e66f5ff1fdf5e1d3a3b93fd2"
Push "uqm-0.6.0-3domusic.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Voiceovers" SEC04
SectionIn 1 4 6
AddSize 112291
StrCpy $MANDATORY 0
StrCpy $MD5SUM "d31577b896be935cc2238afd07299b8b"
Push "uqm-0.6.0-voice.uqm"
Push "$INSTDIR\content\packages"
Call HandlePackage
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
SectionGroupEnd
SectionGroup "Modern Remixes" SECGRP03
Section "Pack 1" SEC05
SectionIn 6
AddSize 49012
StrCpy $MANDATORY 0
StrCpy $MD5SUM "2df402b2951c0187604a81c3997fbb9d"
Push "uqm-remix-pack1.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 2" SEC06
SectionIn 6
AddSize 58869
StrCpy $MANDATORY 0
StrCpy $MD5SUM "d5a9fb72b369bf5a5dbca3db9f1e1ea3"
Push "uqm-remix-pack2.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Pack 3" SEC07
SectionIn 6
AddSize 38989
StrCpy $MANDATORY 0
StrCpy $MD5SUM "567bc2d9e3ca067d21170c5ac5538441"
Push "uqm-remix-pack3.zip"
Push "$INSTDIR\content\packages\addons\remix\"
Call HandlePackage
StrCpy $UQMARGS "--addon remix"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
# Section "Pack 4" SEC08
# SectionIn 6
# AddSize 50000 # ESTIMATE: Update later
# StrCpy $MANDATORY 0
# Push "uqm-remix-pack4.zip"
# Push "$INSTDIR\content\packages\addons\remix\"
# Call HandlePackage
# StrCpy $UQMARGS "--addon remix"
# ; Shortcuts
# !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
# !insertmacro MUI_STARTMENU_WRITE_END
# SectionEnd
SectionGroupEnd
Section -ShortcutsAndIcons
SetOutPath $INSTDIR
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk" "$INSTDIR\Manual.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk" "$INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk" "$INSTDIR\WhatsNew.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk" "$WINDIR\notepad" "$UQMUSERDATA\keys.cfg"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Options Configuration.lnk" "$WINDIR\notepad" "$UQMUSERDATA\uqm.cfg"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Keyboard Test.lnk" "$INSTDIR\keyjam.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Saved Games.lnk" "$UQMUSERDATA\save"
IntCmp $MAKEICON 1 0 NoIcon NoIcon
CreateShortCut "$DESKTOP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
NoIcon:
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Set3DOConfig
SectionIn 4
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $UQMUSERDATA
Delete "uqm.cfg"
CopyFiles "$UQMUSERDATA\uqm-3do.cfg" "$UQMUSERDATA\uqm.cfg"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -SetPCConfig
SectionIn 3
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $UQMUSERDATA
Delete "uqm.cfg"
CopyFiles "$UQMUSERDATA\uqm-pc.cfg" "$UQMUSERDATA\uqm.cfg"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\uqm.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP01} "The core executables and content libraries for The Ur-Quan Masters. All elements in this section must be installed for the game to be playable."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Includes the main program, all subsidiary libraries, and basic documentation for The Ur-Quan Masters. Required for play."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Graphics, sound, and the PC-edition music for The Ur-Quan Masters. Required for play. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECICON} "Adds a desktop icon linking directly to The Ur-Quan Masters."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP02} "Optional content packages containing music and sound unique to the 1993 3DO release."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Optional package which includes the remixed songs from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional package containing the voiceovers from the 3DO release. If this package is selected and not present in the packages directory, the installer will attempt to download it."
!insertmacro MUI_DESCRIPTION_TEXT ${SECGRP03} "Optional content packages containing the official UQM remixes by The Precursors. Selecting any element from this group will also enable the 'remix' addon by default in any shortcuts."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC05} `Ur-Quan Masters Remix Pack 1 - 'Super Melee!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC06} `Ur-Quan Masters Remix Pack 2 - 'Neutral Aliens - Don't Shoot!' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_DESCRIPTION_TEXT ${SEC07} `Ur-Quan Masters Remix Pack 3 - 'The Ur-Quan Hierarchy.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
# !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} `Ur-Quan Masters Remix Pack 4 - 'The New Alliance of Free Stars.' Optional add-on music package. If this package is selected and not present in the packages directory, the installer will attempt to download it.`
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack4.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack3.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack2.zip"
Delete "$INSTDIR\content\packages\addons\remix\uqm-remix-pack1.zip"
Delete "$INSTDIR\content\packages\uqm-0.6.0-voice.uqm"
Delete "$INSTDIR\content\packages\uqm-0.6.0-3domusic.uqm"
Delete "$INSTDIR\content\packages\uqm-0.6.0-content.uqm"
Delete "$INSTDIR\content\version"
Delete "$INSTDIR\zlib.dll"
Delete "$INSTDIR\zlib1.dll"
Delete "$INSTDIR\WhatsNew.txt"
Delete "$INSTDIR\vorbisfile.dll"
Delete "$INSTDIR\vorbis.dll"
Delete "$INSTDIR\uqm.exe"
Delete "$INSTDIR\keyjam.exe"
Delete "$INSTDIR\SDL_gfx.dll"
Delete "$INSTDIR\SDL_image.dll"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\README.txt"
Delete "$INSTDIR\OpenAL32.dll"
Delete "$INSTDIR\ogg.dll"
Delete "$INSTDIR\Manual.txt"
Delete "$INSTDIR\libpng13.dll"
Delete "$INSTDIR\libpng12.dll"
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\AUTHORS.txt"
Delete "$INSTDIR\stderr.txt"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Options Configuration.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Key Configuration.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Keyboard Test.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Saved Games.lnk"
Delete "$DESKTOP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\Manual.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\README.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\WhatsNew.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP\Documentation"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\content\packages\addons\remix"
RMDir "$INSTDIR\content\packages\addons"
RMDir "$INSTDIR\content\packages"
RMDir "$INSTDIR\content"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
-369
View File
@@ -1,369 +0,0 @@
!define MUI_PRODUCT "The Ur-Quan Masters"
!echo "Loading options.nsh file..."
!include "options.nsh"
!echo "Loading content.nsh file..."
!include "content.nsh"
!ifndef CONTENT_ROOT
!define CONTENT_ROOT "content"
!endif
!ifndef PACKAGE_ROOT
!define PACKAGE_ROOT "${CONTENT_ROOT}\packages"
!endif
; ***************** content **********************
!ifndef CONTENT_LOCATION
!ifdef CONTENT_USE_MIRROR
!define CONTENT_LOCATION ${MIRROR_LOCATION}
!else
!define CONTENT_LOCATION ${DOWNLOAD_LOCATION}
!endif
!endif
!ifndef CONTENT_USE_MIRROR
!define CONTENT_USE_MIRROR 0
!endif
!ifndef CONTENT_PACKAGE_FILE
!define CONTENT_PACKAGE_FILE "uqm-${MUI_VERSION}-content.zip"
!endif
; ****************** voice **********************
!ifndef VOICE_LOCATION
!ifdef VOICE_USE_MIRROR
!define VOICE_LOCATION ${MIRROR_LOCATION}
!else
!define VOICE_LOCATION ${DOWNLOAD_LOCATION}
!endif
!endif
!ifndef VOICE_USE_MIRROR
!define VOICE_USE_MIRROR 0
!endif
!ifndef VOICE_PACKAGE_FILE
!define VOICE_PACKAGE_FILE "uqm-${MUI_VERSION}-voice.zip"
!endif
; **************** 3do music *********************
!ifndef THREEDO_LOCATION
!ifdef THREEDO_USE_MIRROR
!define THREEDO_LOCATION ${MIRROR_LOCATION}
!else
!define THREEDO_LOCATION ${DOWNLOAD_LOCATION}
!endif
!endif
!ifndef THREEDO_USE_MIRROR
!define THREEDO_USE_MIRROR 0
!endif
!ifndef THREEDO_PACKAGE_FILE
!define THREEDO_PACKAGE_FILE "uqm-${MUI_VERSION}-3domusic.zip"
!endif
;--------------------------------
!include "MUI.nsh"
;--------------------------------
;Configuration
;Preprocessing of input files
!ifdef USE_UBX
!system 'upx --best --crp-ms=100000 -f -q ..\..\uqm.exe' ignore
!packhdr temp.dat "upx.exe --best --crp-ms=100000 temp.dat"
!endif
;Page order
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;Language Files
;English
; We will leave language support, buft sincne English is
; the only language we have so far, there's no reason to pop up a dialog
!insertmacro MUI_LANGUAGE "English"
!include "uqm_english.nsh"
OutFile "uqm-${MUI_VERSION}-win32-installer.exe"
SetOverwrite on
AutoCloseWindow false
ShowInstDetails show
ShowUninstDetails show
;Folder-select dialog
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
;Things that need to be extracted on startup (keep these lines before any File command!)
ReserveFile "${NSISDIR}\Plugins\NSISdl.dll"
;Installer Sections
InstType $(InstTypeFullName)
InstType $(InstTypeExeName)
Section !$(SecUQMName) SecUQM
SectionIn 1 2 RO
CreateDirectory "$INSTDIR\${PACKAGE_ROOT}"
CreateDirectory "$INSTDIR\${PACKAGE_ROOT}\addons"
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "..\..\uqm.exe"
File /oname=WhatsNew.txt "..\..\WhatsNew"
File /oname=Manual.txt "..\..\doc\users\manual.txt"
File /oname=COPYING.txt "..\..\COPYING"
File /oname=AUTHORS.txt "..\..\AUTHORS"
File /oname=README.txt "..\..\README"
SetOutPath $INSTDIR\${CONTENT_ROOT}
File "..\..\content\version"
SetOutPath $INSTDIR
; Write the installation path into the registry
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "Software\${MUI_PRODUCT}" "Install_Dir" "$INSTDIR"
; Write the version into the registry for easy upgrade
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Version" "${MUI_VERSION}"
WriteRegStr HKLM "Software\${MUI_PRODUCT}" "Version" "${MUI_VERSION}"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" '"$INSTDIR\uninstall.exe"'
;Create the uninstaller
WriteUninstaller uninstall.exe
SectionEnd
Section $(SecContentName) SecContent
SectionIn 1
AddSize ${CONTENT_SIZE}
; $0 = download file name
; $1 = web site for download or mirror
; $2 = install directory
; $3 = use mirror
StrCpy $0 ${CONTENT_PACKAGE_FILE}
StrCpy $1 ${CONTENT_LOCATION}
StrCpy $2 "$INSTDIR\${PACKAGE_ROOT}"
StrCpy $3 ${CONTENT_USE_MIRROR}
call Download
Pop $0
StrCmp $0 success content_ok content_failure
content_ok:
StrCpy $0 "content"
goto content_end
content_failure:
StrCpy $0 ""
content_end:
SectionEnd
Section $(SecVoiceName) SecVoice
SectionIn 1
AddSize ${VOICE_SIZE}
; $0 = download file name
; $1 = web site for download or mirror
; $2 = install directory
; $3 = use mirror
StrCpy $0 ${VOICE_PACKAGE_FILE}
StrCpy $1 ${VOICE_LOCATION}
StrCpy $2 "$INSTDIR\${PACKAGE_ROOT}"
StrCpy $3 ${VOICE_USE_MIRROR}
call Download
Pop $0
StrCmp $0 success voice_ok voice_failure
voice_ok:
StrCpy $0 "voice"
goto voice_end
voice_failure:
StrCpy $0 ""
voice_end:
SectionEnd
Section $(Sec3doMusicName) Sec3doMusic
SectionIn 1
AddSize ${THREEDO_SIZE}
; $0 = download file name
; $1 = web site for download or mirror
; $2 = install directory
; $3 = use mirror
StrCpy $0 ${THREEDO_PACKAGE_FILE}
StrCpy $1 ${THREEDO_LOCATION}
StrCpy $2 "$INSTDIR\${PACKAGE_ROOT}"
StrCpy $3 ${THREEDO_USE_MIRROR}
call Download
Pop $0
StrCmp $0 success threedo_ok threedo_failure
threedo_ok:
StrCpy $0 "3domusic"
goto threedo_end
threedo_failure:
StrCpy $0 ""
threedo_end:
SectionEnd
SubSection $(SecSupportDLLName) SecSupportDLL
Section $(SecSDLName) SecSDL
SectionIn 1 2
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "..\..\SDL.dll"
File "..\..\zlib.dll"
File "..\..\libpng1.dll"
File "..\..\jpeg.dll"
File "..\..\SDL_image.dll"
SectionEnd
Section $(SecVoiceDLLName) SecVoiceDLL
SectionIn 1 2
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "..\..\vorbisfile.dll"
File "..\..\vorbis.dll"
File "..\..\ogg.dll"
SectionEnd
Section $(SecOpenALName) SecOpenAL
SectionIn 1 2
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "..\..\OpenAL32.dll"
SectionEnd
SubSectionEnd
Section $(SecStartMenuName) SecStartMenu
SectionIn 1 2
CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}\Documentation"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\Manual.lnk" "$INSTDIR\Manual.txt"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\README.lnk" "$INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\WhatsNew.lnk" "$INSTDIR\WhatsNew.txt"
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\uqm.exe" "" "$INSTDIR\uqm.exe" 0
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
SectionEnd
Section $(SecDesktopIconName) SecDesktopIcon
SectionIn 1 2
CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\uqm.exe" "" "$INSTDIR\uqm.exe" 0
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
;Init InstallOptions
!define SF_SELECTED 1
!define SECTION_OFF 0xFFFFFFFE
FunctionEnd
!include "download.nsh"
;--------------------------------
;Descriptions
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecUQM} $(SecUQMDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecContent} $(SecContentDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecVoice} $(SecVoiceDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${Sec3doMusic} $(Sec3doMusicDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecSupportDLL} $(SecSupportDLLDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecSDL} $(SecSDLDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecOpenAL} $(SecOpenALDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecVoiceDLL} $(SecVoiceDLLDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(SecStartMenuDesc)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopIcon} $(SecDesktopIconDesc)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
;--------------------------------
;Uninstaller section
Section "Uninstall"
;Add your stuff here
; remove registry keys
DeleteRegKey HKCU "Software\${MUI_PRODUCT}"
DeleteRegKey HKLM "Software\${MUI_PRODUCT}"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
; remove files
Delete "$INSTDIR\uqm.exe"
Delete "$INSTDIR\WhatsNew.txt"
Delete "$INSTDIR\Manual.txt"
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\AUTHORS.txt"
Delete "$INSTDIR\README.txt"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\zlib.dll"
Delete "$INSTDIR\libpng1.dll"
Delete "$INSTDIR\jpeg.dll"
Delete "$INSTDIR\SDL_image.dll"
Delete "$INSTDIR\OpenAL32.dll"
Delete "$INSTDIR\vorbisfile.dll"
Delete "$INSTDIR\vorbis.dll"
Delete "$INSTDIR\ogg.dll"
; remove content packages
Delete "$INSTDIR\${PACKAGE_ROOT}\${CONTENT_PACKAGE_FILE}"
Delete "$INSTDIR\${PACKAGE_ROOT}\${VOICE_PACKAGE_FILE}"
Delete "$INSTDIR\${PACKAGE_ROOT}\${THREEDO_PACKAGE_FILE}"
Delete "$INSTDIR\${CONTENT_ROOT}\version"
; MUST REMOVE UNINSTALLER, too
Delete $INSTDIR\uninstall.exe
; remove shortcuts, if any.
Delete "$SMPROGRAMS\${MUI_PRODUCT}\Documentation\*.*"
Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
; remove directories used.
RMDir "$SMPROGRAMS\${MUI_PRODUCT}\Documentation"
RMDir "$SMPROGRAMS\${MUI_PRODUCT}"
RMDir "$INSTDIR\${PACKAGE_ROOT}\addons"
RMDir "$INSTDIR\${PACKAGE_ROOT}"
RMDir "$INSTDIR\${CONTENT_ROOT}"
RMDir "$INSTDIR"
SectionEnd
;--------------------------------
;Uninstaller Functions
;--------------------------------
;The Ur-Quan Masters install script
;Based on
;NSIS Modern Style UI version 1.61
;Multilanguage & LangDLL Example Script
;Written by Joost Verburg
;and FileZilla installation
;written by Tim Kosse (mailto:tim.kosse@gmx.de)
-64
View File
@@ -1,64 +0,0 @@
;Language specific include file for The Ur-Quan Masters installer
;Based on installer for FileZilla
!verbose 3
;License dialog
LicenseData /LANG=${LANG_ENGLISH} "..\..\COPYING"
;Component-select dialog
LangString InstTypeFullName ${LANG_ENGLISH} "Full"
LangString InstTypeExeName ${LANG_ENGLISH} "Executable Only"
LangString SecUQMName ${LANG_ENGLISH} "The Ur-Quan Masters (required)"
LangString SecContentName ${LANG_ENGLISH} "Install data files"
LangString SecVoiceName ${LANG_ENGLISH} "Install voice files"
LangString Sec3doMusicName ${LANG_ENGLISH} "Install 3DO Music"
LangString SecSupportDLLName ${LANG_ENGLISH} "Graphics/Sound libs"
LangString SecSDLName ${LANG_ENGLISH} "SDL"
LangString SecOpenALName ${LANG_ENGLISH} "OpenAL"
LangString SecVoiceDLLName ${LANG_ENGLISH} "Voice"
LangString SecStartMenuName ${LANG_ENGLISH} "Start Menu Shortcuts"
LangString SecDesktopIconName ${LANG_ENGLISH} "Desktop Icon"
LangString SecUQMDesc ${LANG_ENGLISH} "Install uqm.exe and other required files"
LangString SecContentDesc ${LANG_ENGLISH} "Download all data files needed to play uqm."
LangString SecVoiceDesc ${LANG_ENGLISH} "Download optional voice files (gives voices to go along with the subtitles)."
LangString Sec3doMusicDesc ${LANG_ENGLISH} "Download optional music from the 3do version."
LangString SecSupportDLLDesc ${LANG_ENGLISH} "Install support .dll files needed to play The Ur-Quan Masters"
LangString SecSDLDesc ${LANG_ENGLISH} "Install SDL and SDL_image libraries for graphics and sound support"
LangString SecOpenALDesc ${LANG_ENGLISH} "Install OpenAL audio drivers"
LangString SecVoiceDLLDesc ${LANG_ENGLISH} "Install OggVorbis libraries for playing voice"
LangString SecStartMenuDesc ${LANG_ENGLISH} "Create shortcuts in the Start Menu"
LangString SecDesktopIconDesc ${LANG_ENGLISH} "Add a desktop icon for quick access to The Ur-Quan Masters"
;Page titles
LangString PageDownloadTitle ${LANG_ENGLISH} "Download options"
LangString PageDownloadSubTitle ${LANG_ENGLISH} "Some components have to be downloaded"
;Download dialog
LangString DownloadDialogNext1 ${LANG_ENGLISH} "&Install"
LangString DownloadDialogNext2 ${LANG_ENGLISH} "&Next >"
LangString DownloadDialog1 ${LANG_ENGLISH} "The following components are not included in the installer to reduce its size:"
LangString DownloadDialog3 ${LANG_ENGLISH} "To install these components, the installer can download the required files. If you don't want to download the files now, you can run the installer again later, or you can download the files manually from http://sc2.sourceforge.net/"
LangString DownloadDialog4 ${LANG_ENGLISH} "Download and Install from the internet"
LangString DownloadDialog5 ${LANG_ENGLISH} "Skip these components"
;Download strings
LangString DownloadDownloading ${LANG_ENGLISH} "Downloading $0"
LangString DownloadRetrievingMirrorList ${LANG_ENGLISH} " Retrieving mirror list from $1" ;Don't remove the leading two whitespaces
LangString DownloadDownloadFailed ${LANG_ENGLISH} " Download attempt failed: $0" ;Don't remove the leading two whitespaces
LangString DownloadMirrorDownloadFailedBox ${LANG_ENGLISH} "Failed to download mirror list for $0. Reason: $R1$\nThis component will not be installed.$\nRun the installer again later to retry downloading this component.$\nIf this error stays, the installer may not able to access the internet. In any case you can download the components manually from http://sc2.sourceforge.net/"
LangString DownloadDownloadCancelled ${LANG_ENGLISH} " Download cancelled" ;Don't remove the leading two whitespaces
LangString DownloadRetrievingMirrorListSuccessful ${LANG_ENGLISH} " Mirror list download successful" ;Don't remove the leading two whitespaces
LangString DownloadUsingMirror ${LANG_ENGLISH} " Using mirror $R3" ;Don't remove the leading two whitespaces
LangString DownloadDownloadFailedBox ${LANG_ENGLISH} "Failed to download $0. Reason: $R1$\nThis component will not be installed.$\nRun the installer again later to retry downloading this component.$\nIf this error stays, the installer may not able to access the internet. In any case you can download the components manually from http://sc2.sourceforge.net/"
LangString DownloadDownloadSuccessful ${LANG_ENGLISH} " Download successful" ;Don't remove the leading two whitespaces
; Mirror problems
LangString DownloadMirrorBroken ${LANG_ENGLISH} "Failed to parse mirror file"
LangString DownloadMirrorBrokenDlg ${LANG_ENGLISH} "There were problems reading the mirror file. We will not be able to install downloaded content. You can retrieve the files directly from http://sc2.sourceforge.net/"
;Uninstaller
LangString un.QuestionDeleteRegistry ${LANG_ENGLISH} "Delete all Registry keys created by Ur-Quan Masters?"
!verbose 4