├── .gitignore ├── README.md ├── etc └── nquake.ini ├── include ├── Include │ ├── FileAssociation.nsh │ ├── Locate.nsh │ ├── StrContains.nsh │ ├── StrStr.nsh │ ├── Time.nsh │ ├── VersionCompare.nsh │ └── VersionConvert.nsh └── Plugins │ ├── RealProgress.dll │ ├── inetc.dll │ ├── locate.dll │ ├── nsisunz.dll │ └── time.dll ├── releases ├── nquake29_installer.exe └── nquake_installer-latest.exe └── src ├── addons.ini ├── association.ini ├── config.ini ├── download.ini ├── errors.ini ├── gnu.txt ├── license.txt ├── nquake-header.bmp ├── nquake-installer_source.nsi ├── nquake-macros.nsh ├── nquake-welcomefinish.bmp ├── nquake.ico └── uninstall.ini /.gitignore: -------------------------------------------------------------------------------- 1 | src/*.exe 2 | changelog.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nQuake for Windows 2 | ====== 3 | 4 | To compile an nQuake installer, follow these steps: 5 | 6 | 1) Download NSIS (http://nsis.sourceforge.net/) - version 2.x or v3.0+ doesn't matter.
7 | 2) Copy/move the folders in the `include` folder to `C:\Program Files (x86)\NSIS\`.
8 | _For NSIS v3.0+ you need to move the plugins (.dll files) to the "x86-ansi" subfolder of "Plugins"._
9 | 3) Right-click the `nquake-installer_source.nsi` file and open with makensisw.exe.
10 | 11 | Tips:
12 | * Most of the code resides in `nquake-installer_source.nsi` but some code that is used often can be found in `nquake-macros.nsh`.
13 | * Edit the contents of the installer pages in the .ini files and their functions in the installer source file (e.g. Function DOWNLOAD for the download page).
14 | 15 | If you decide to fork nQuake into your own installer, I would love to get some credit, but since this is GPL I can't force you :) 16 | -------------------------------------------------------------------------------- /etc/nquake.ini: -------------------------------------------------------------------------------- 1 | [distfile_sizes] 2 | addon-fortress.zip=8327 3 | addon-clanarena.zip=13544 4 | addon-textures.zip=423501 5 | gpl.zip=18847 6 | linux.zip=7700 7 | macosx.zip=3244 8 | non-gpl.zip=54257 9 | qsw106.zip=8833 10 | textures.zip=19583 11 | sv-bin-win32.zip=764 12 | sv-win32.zip=0 13 | sv-ca.zip=356 14 | sv-configs.zip=19 15 | sv-ffa.zip=2 16 | sv-fortress.zip=33653 17 | sv-gpl.zip=3898 18 | sv-maps.zip=39310 19 | sv-maps-gpl.zip=3073 20 | sv-non-gpl.zip=39794 21 | [distfile_dates] 22 | addon-fortress.zip=20990101000000 23 | addon-clanarena.zip=20990101000000 24 | addon-textures.zip=20990101000000 25 | gpl.zip=20990101000000 26 | linux.zip=20990101000000 27 | macosx.zip=20990101000000 28 | non-gpl.zip=20990101000000 29 | qsw106.zip=20990101000000 30 | textures.zip=20990101000000 31 | sv-bin-win32.zip=20990101000000 32 | sv-win32.zip=20990101000000 33 | sv-ca.zip=20990101000000 34 | sv-configs.zip=20990101000000 35 | sv-ffa.zip=20990101000000 36 | sv-fortress.zip=20990101000000 37 | sv-gpl.zip=20990101000000 38 | sv-maps.zip=20990101000000 39 | sv-maps-gpl.zip=20990101000000 40 | sv-non-gpl.zip=20990101000000 41 | [mirror_addresses] 42 | 1=https://github.com/nQuake/distfiles/releases/download/snapshot 43 | [mirror_descriptions] 44 | 1="GitHub" 45 | [versions] 46 | windows=2.9 47 | linux=2.2 48 | macosx=2.1 49 | server=1.6 50 | -------------------------------------------------------------------------------- /include/Include/FileAssociation.nsh: -------------------------------------------------------------------------------- 1 | /* 2 | _____________________________________________________________________________ 3 | 4 | File Association 5 | _____________________________________________________________________________ 6 | 7 | Based on code taken from http://nsis.sourceforge.net/File_Association 8 | 9 | Usage in script: 10 | 1. !include "FileAssociation.nsh" 11 | 2. [Section|Function] 12 | ${FileAssociationFunction} "Param1" "Param2" "..." $var 13 | [SectionEnd|FunctionEnd] 14 | 15 | FileAssociationFunction=[RegisterExtension|UnRegisterExtension] 16 | 17 | _____________________________________________________________________________ 18 | 19 | ${RegisterExtension} "[executable]" "[extension]" "[description]" 20 | 21 | "[executable]" ; executable which opens the file format 22 | ; 23 | "[extension]" ; extension, which represents the file format to open 24 | ; 25 | "[description]" ; description for the extension. This will be display in Windows Explorer. 26 | ; 27 | 28 | 29 | ${UnRegisterExtension} "[extension]" "[description]" 30 | 31 | "[extension]" ; extension, which represents the file format to open 32 | ; 33 | "[description]" ; description for the extension. This will be display in Windows Explorer. 34 | ; 35 | 36 | _____________________________________________________________________________ 37 | 38 | Macros 39 | _____________________________________________________________________________ 40 | 41 | Change log window verbosity (default: 3=no script) 42 | 43 | Example: 44 | !include "FileAssociation.nsh" 45 | !insertmacro RegisterExtension 46 | ${FileAssociation_VERBOSE} 4 # all verbosity 47 | !insertmacro UnRegisterExtension 48 | ${FileAssociation_VERBOSE} 3 # no script 49 | */ 50 | 51 | 52 | !ifndef FileAssociation_INCLUDED 53 | !define FileAssociation_INCLUDED 54 | 55 | !include Util.nsh 56 | 57 | !verbose push 58 | !verbose 3 59 | !ifndef _FileAssociation_VERBOSE 60 | !define _FileAssociation_VERBOSE 3 61 | !endif 62 | !verbose ${_FileAssociation_VERBOSE} 63 | !define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE` 64 | !verbose pop 65 | 66 | !macro FileAssociation_VERBOSE _VERBOSE 67 | !verbose push 68 | !verbose 3 69 | !undef _FileAssociation_VERBOSE 70 | !define _FileAssociation_VERBOSE ${_VERBOSE} 71 | !verbose pop 72 | !macroend 73 | 74 | 75 | 76 | !macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION 77 | !verbose push 78 | !verbose ${_FileAssociation_VERBOSE} 79 | Push `${_DESCRIPTION}` 80 | Push `${_EXTENSION}` 81 | Push `${_EXECUTABLE}` 82 | ${CallArtificialFunction} RegisterExtension_ 83 | !verbose pop 84 | !macroend 85 | 86 | !macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION 87 | !verbose push 88 | !verbose ${_FileAssociation_VERBOSE} 89 | Push `${_EXTENSION}` 90 | Push `${_DESCRIPTION}` 91 | ${CallArtificialFunction} UnRegisterExtension_ 92 | !verbose pop 93 | !macroend 94 | 95 | 96 | 97 | !define RegisterExtension `!insertmacro RegisterExtensionCall` 98 | !define un.RegisterExtension `!insertmacro RegisterExtensionCall` 99 | 100 | !macro RegisterExtension 101 | !macroend 102 | 103 | !macro un.RegisterExtension 104 | !macroend 105 | 106 | !macro RegisterExtension_ 107 | !verbose push 108 | !verbose ${_FileAssociation_VERBOSE} 109 | 110 | Exch $R2 ;exe 111 | Exch 112 | Exch $R1 ;ext 113 | Exch 114 | Exch 2 115 | Exch $R0 ;desc 116 | Exch 2 117 | Push $0 118 | Push $1 119 | 120 | ReadRegStr $1 HKCR $R1 "" ; read current file association 121 | StrCmp "$1" "" NoBackup ; is it empty 122 | StrCmp "$1" "$R0" NoBackup ; is it our own 123 | WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value 124 | NoBackup: 125 | WriteRegStr HKCR $R1 "" "$R0" ; set our file association 126 | 127 | ReadRegStr $0 HKCR $R0 "" 128 | StrCmp $0 "" 0 Skip 129 | WriteRegStr HKCR "$R0" "" "$R0" 130 | WriteRegStr HKCR "$R0\shell" "" "open" 131 | WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" 132 | Skip: 133 | WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"' 134 | WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" 135 | WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"' 136 | 137 | Pop $1 138 | Pop $0 139 | Pop $R2 140 | Pop $R1 141 | Pop $R0 142 | 143 | !verbose pop 144 | !macroend 145 | 146 | 147 | 148 | !define UnRegisterExtension `!insertmacro UnRegisterExtensionCall` 149 | !define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall` 150 | 151 | !macro UnRegisterExtension 152 | !macroend 153 | 154 | !macro un.UnRegisterExtension 155 | !macroend 156 | 157 | !macro UnRegisterExtension_ 158 | !verbose push 159 | !verbose ${_FileAssociation_VERBOSE} 160 | 161 | Exch $R1 ;desc 162 | Exch 163 | Exch $R0 ;ext 164 | Exch 165 | Push $0 166 | Push $1 167 | 168 | ReadRegStr $1 HKCR $R0 "" 169 | StrCmp $1 $R1 0 NoOwn ; only do this if we own it 170 | ReadRegStr $1 HKCR $R0 "backup_val" 171 | StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key 172 | DeleteRegKey HKCR $R0 173 | Goto NoOwn 174 | 175 | Restore: 176 | WriteRegStr HKCR $R0 "" $1 177 | DeleteRegValue HKCR $R0 "backup_val" 178 | DeleteRegKey HKCR $R1 ;Delete key with association name settings 179 | 180 | NoOwn: 181 | 182 | Pop $1 183 | Pop $0 184 | Pop $R1 185 | Pop $R0 186 | 187 | !verbose pop 188 | !macroend 189 | 190 | !endif # !FileAssociation_INCLUDED -------------------------------------------------------------------------------- /include/Include/Locate.nsh: -------------------------------------------------------------------------------- 1 | !define locate::Open `!insertmacro locate::Open` 2 | 3 | !macro locate::Open _PATH _OPTIONS _ERR 4 | locate::_Open /NOUNLOAD `${_PATH}` `${_OPTIONS}` 5 | Pop ${_ERR} 6 | !macroend 7 | 8 | 9 | !define locate::Find `!insertmacro locate::Find` 10 | 11 | !macro locate::Find _PATH_NAME _PATH _NAME _SIZE _TIME _ATTRIB 12 | locate::_Find /NOUNLOAD 13 | Pop ${_PATH_NAME} 14 | Pop ${_PATH} 15 | Pop ${_NAME} 16 | Pop ${_SIZE} 17 | Pop ${_TIME} 18 | Pop ${_ATTRIB} 19 | !macroend 20 | 21 | 22 | !define locate::Close `!insertmacro locate::Close` 23 | 24 | !macro locate::Close 25 | locate::_Close /NOUNLOAD 26 | !macroend 27 | 28 | 29 | !define locate::GetSize `!insertmacro locate::GetSize` 30 | 31 | !macro locate::GetSize _PATH _OPTIONS _SIZE _FILES _DIRS 32 | locate::_GetSize /NOUNLOAD `${_PATH}` `${_OPTIONS}` 33 | Pop ${_SIZE} 34 | Pop ${_FILES} 35 | Pop ${_DIRS} 36 | !macroend 37 | 38 | 39 | !define locate::RMDirEmpty `!insertmacro locate::RMDirEmpty` 40 | 41 | !macro locate::RMDirEmpty _PATH _OPTIONS _REMOVED 42 | locate::_RMDirEmpty /NOUNLOAD `${_PATH}` `${_OPTIONS}` 43 | Pop ${_REMOVED} 44 | !macroend 45 | 46 | 47 | !define locate::Unload `!insertmacro locate::Unload` 48 | 49 | !macro locate::Unload 50 | locate::_Unload 51 | !macroend 52 | -------------------------------------------------------------------------------- /include/Include/StrContains.nsh: -------------------------------------------------------------------------------- 1 | ; StrContains 2 | ; This function does a case sensitive searches for an occurrence of a substring in a string. 3 | ; It returns the substring if it is found. 4 | ; Otherwise it returns null(""). 5 | ; Written by kenglish_hi 6 | ; Adapted from StrReplace written by dandaman32 7 | 8 | 9 | Var STR_HAYSTACK 10 | Var STR_NEEDLE 11 | Var STR_CONTAINS_VAR_1 12 | Var STR_CONTAINS_VAR_2 13 | Var STR_CONTAINS_VAR_3 14 | Var STR_CONTAINS_VAR_4 15 | Var STR_RETURN_VAR 16 | 17 | Function StrContains 18 | Exch $STR_NEEDLE 19 | Exch 1 20 | Exch $STR_HAYSTACK 21 | ; Uncomment to debug 22 | ;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK ' 23 | StrCpy $STR_RETURN_VAR "" 24 | StrCpy $STR_CONTAINS_VAR_1 -1 25 | StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE 26 | StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK 27 | loop: 28 | IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1 29 | StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1 30 | StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found 31 | StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done 32 | Goto loop 33 | found: 34 | StrCpy $STR_RETURN_VAR $STR_NEEDLE 35 | Goto done 36 | done: 37 | Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the 38 | Exch $STR_RETURN_VAR 39 | FunctionEnd 40 | 41 | !macro _StrContainsConstructor OUT NEEDLE HAYSTACK 42 | Push `${HAYSTACK}` 43 | Push `${NEEDLE}` 44 | Call StrContains 45 | Pop `${OUT}` 46 | !macroend 47 | 48 | !define StrContains '!insertmacro "_StrContainsConstructor"' -------------------------------------------------------------------------------- /include/Include/StrStr.nsh: -------------------------------------------------------------------------------- 1 | !define StrStr "!insertmacro StrStr" 2 | 3 | !macro StrStr ResultVar String SubString 4 | Push `${String}` 5 | Push `${SubString}` 6 | Call StrStr 7 | Pop `${ResultVar}` 8 | !macroend 9 | 10 | Function StrStr 11 | /*After this point: 12 | ------------------------------------------ 13 | $R0 = SubString (input) 14 | $R1 = String (input) 15 | $R2 = SubStringLen (temp) 16 | $R3 = StrLen (temp) 17 | $R4 = StartCharPos (temp) 18 | $R5 = TempStr (temp)*/ 19 | 20 | ;Get input from user 21 | Exch $R0 22 | Exch 23 | Exch $R1 24 | Push $R2 25 | Push $R3 26 | Push $R4 27 | Push $R5 28 | 29 | ;Get "String" and "SubString" length 30 | StrLen $R2 $R0 31 | StrLen $R3 $R1 32 | ;Start "StartCharPos" counter 33 | StrCpy $R4 0 34 | 35 | ;Loop until "SubString" is found or "String" reaches its end 36 | ${Do} 37 | ;Remove everything before and after the searched part ("TempStr") 38 | StrCpy $R5 $R1 $R2 $R4 39 | 40 | ;Compare "TempStr" with "SubString" 41 | ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|} 42 | ;If not "SubString", this could be "String"'s end 43 | ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|} 44 | ;If not, continue the loop 45 | IntOp $R4 $R4 + 1 46 | ${Loop} 47 | 48 | /*After this point: 49 | ------------------------------------------ 50 | $R0 = ResultVar (output)*/ 51 | 52 | ;Remove part before "SubString" on "String" (if there has one) 53 | StrCpy $R0 $R1 `` $R4 54 | 55 | ;Return output to user 56 | Pop $R5 57 | Pop $R4 58 | Pop $R3 59 | Pop $R2 60 | Pop $R1 61 | Exch $R0 62 | FunctionEnd -------------------------------------------------------------------------------- /include/Include/Time.nsh: -------------------------------------------------------------------------------- 1 | !define time::GetLocalTime `!insertmacro time::GetLocalTime` 2 | 3 | !macro time::GetLocalTime _TIME 4 | time::_GetLocalTime /NOUNLOAD 5 | Pop ${_TIME} 6 | !macroend 7 | 8 | 9 | !define time::GetLocalTimeUTC `!insertmacro time::GetLocalTimeUTC` 10 | 11 | !macro time::GetLocalTimeUTC _TIME 12 | time::_GetLocalTimeUTC /NOUNLOAD 13 | Pop ${_TIME} 14 | !macroend 15 | 16 | 17 | !define time::SetLocalTime `!insertmacro time::SetLocalTime` 18 | 19 | !macro time::SetLocalTime _TIME _ERR 20 | time::_SetLocalTime /NOUNLOAD `${_TIME}` 21 | Pop ${_ERR} 22 | !macroend 23 | 24 | 25 | !define time::SetLocalTimeUTC `!insertmacro time::SetLocalTimeUTC` 26 | 27 | !macro time::SetLocalTimeUTC _TIME _ERR 28 | time::_SetLocalTimeUTC /NOUNLOAD `${_TIME}` 29 | Pop ${_ERR} 30 | !macroend 31 | 32 | 33 | !define time::GetFileTime `!insertmacro time::GetFileTime` 34 | 35 | !macro time::GetFileTime _FILE _CREATION _WRITE _ACCESS 36 | time::_GetFileTime /NOUNLOAD `${_FILE}` 37 | Pop ${_CREATION} 38 | Pop ${_WRITE} 39 | Pop ${_ACCESS} 40 | !macroend 41 | 42 | 43 | !define time::GetFileTimeUTC `!insertmacro time::GetFileTimeUTC` 44 | 45 | !macro time::GetFileTimeUTC _FILE _CREATION _WRITE _ACCESS 46 | time::_GetFileTimeUTC /NOUNLOAD `${_FILE}` 47 | Pop ${_CREATION} 48 | Pop ${_WRITE} 49 | Pop ${_ACCESS} 50 | !macroend 51 | 52 | 53 | !define time::SetFileTime `!insertmacro time::SetFileTime` 54 | 55 | !macro time::SetFileTime _FILE _CREATION _WRITE _ACCESS _ERR 56 | time::_SetFileTime /NOUNLOAD `${_FILE}` `${_CREATION}` `${_WRITE}` `${_ACCESS}` 57 | Pop ${_ERR} 58 | !macroend 59 | 60 | 61 | !define time::SetFileTimeUTC `!insertmacro time::SetFileTimeUTC` 62 | 63 | !macro time::SetFileTimeUTC _FILE _CREATION _WRITE _ACCESS _ERR 64 | time::_SetFileTimeUTC /NOUNLOAD `${_FILE}` `${_CREATION}` `${_WRITE}` `${_ACCESS}` 65 | Pop ${_ERR} 66 | !macroend 67 | 68 | 69 | !define time::TimeString `!insertmacro time::TimeString` 70 | 71 | !macro time::TimeString _TIME _DAY _MONTH _YEAR _HOUR _MINUTE _SECOND 72 | time::_TimeString /NOUNLOAD `${_TIME}` 73 | Pop ${_DAY} 74 | Pop ${_MONTH} 75 | Pop ${_YEAR} 76 | Pop ${_HOUR} 77 | Pop ${_MINUTE} 78 | Pop ${_SECOND} 79 | !macroend 80 | 81 | 82 | !define time::MathTime `!insertmacro time::MathTime` 83 | 84 | !macro time::MathTime _EXPRESSION _ERR 85 | time::_MathTime /NOUNLOAD `${_EXPRESSION}` 86 | Pop ${_ERR} 87 | !macroend 88 | 89 | 90 | !define time::Unload `!insertmacro time::Unload` 91 | 92 | !macro time::Unload 93 | time::_Unload 94 | !macroend 95 | -------------------------------------------------------------------------------- /include/Include/VersionCompare.nsh: -------------------------------------------------------------------------------- 1 | Function VersionCompare 2 | !define VersionCompare `!insertmacro VersionCompareCall` 3 | 4 | !macro VersionCompareCall _VER1 _VER2 _RESULT 5 | Push `${_VER1}` 6 | Push `${_VER2}` 7 | Call VersionCompare 8 | Pop ${_RESULT} 9 | !macroend 10 | 11 | Exch $1 12 | Exch 13 | Exch $0 14 | Exch 15 | Push $2 16 | Push $3 17 | Push $4 18 | Push $5 19 | Push $6 20 | Push $7 21 | 22 | begin: 23 | StrCpy $2 -1 24 | IntOp $2 $2 + 1 25 | StrCpy $3 $0 1 $2 26 | StrCmp $3 '' +2 27 | StrCmp $3 '.' 0 -3 28 | StrCpy $4 $0 $2 29 | IntOp $2 $2 + 1 30 | StrCpy $0 $0 '' $2 31 | 32 | StrCpy $2 -1 33 | IntOp $2 $2 + 1 34 | StrCpy $3 $1 1 $2 35 | StrCmp $3 '' +2 36 | StrCmp $3 '.' 0 -3 37 | StrCpy $5 $1 $2 38 | IntOp $2 $2 + 1 39 | StrCpy $1 $1 '' $2 40 | 41 | StrCmp $4$5 '' equal 42 | 43 | StrCpy $6 -1 44 | IntOp $6 $6 + 1 45 | StrCpy $3 $4 1 $6 46 | StrCmp $3 '0' -2 47 | StrCmp $3 '' 0 +2 48 | StrCpy $4 0 49 | 50 | StrCpy $7 -1 51 | IntOp $7 $7 + 1 52 | StrCpy $3 $5 1 $7 53 | StrCmp $3 '0' -2 54 | StrCmp $3 '' 0 +2 55 | StrCpy $5 0 56 | 57 | StrCmp $4 0 0 +2 58 | StrCmp $5 0 begin newer2 59 | StrCmp $5 0 newer1 60 | IntCmp $6 $7 0 newer1 newer2 61 | 62 | StrCpy $4 '1$4' 63 | StrCpy $5 '1$5' 64 | IntCmp $4 $5 begin newer2 newer1 65 | 66 | equal: 67 | StrCpy $0 0 68 | goto end 69 | newer1: 70 | StrCpy $0 1 71 | goto end 72 | newer2: 73 | StrCpy $0 2 74 | 75 | end: 76 | Pop $7 77 | Pop $6 78 | Pop $5 79 | Pop $4 80 | Pop $3 81 | Pop $2 82 | Pop $1 83 | Exch $0 84 | FunctionEnd -------------------------------------------------------------------------------- /include/Include/VersionConvert.nsh: -------------------------------------------------------------------------------- 1 | Function VersionConvert 2 | !define VersionConvert `!insertmacro VersionConvertCall` 3 | 4 | !macro VersionConvertCall _VERSION _CHARLIST _RESULT 5 | Push `${_VERSION}` 6 | Push `${_CHARLIST}` 7 | Call VersionConvert 8 | Pop ${_RESULT} 9 | !macroend 10 | 11 | Exch $1 12 | Exch 13 | Exch $0 14 | Exch 15 | Push $2 16 | Push $3 17 | Push $4 18 | Push $5 19 | Push $6 20 | Push $7 21 | 22 | StrCmp $1 '' 0 +2 23 | StrCpy $1 'abcdefghijklmnopqrstuvwxyz' 24 | StrCpy $1 $1 99 25 | 26 | StrCpy $2 0 27 | StrCpy $7 'dot' 28 | goto loop 29 | 30 | preloop: 31 | IntOp $2 $2 + 1 32 | 33 | loop: 34 | StrCpy $3 $0 1 $2 35 | StrCmp $3 '' endcheck 36 | StrCmp $3 '.' dot 37 | StrCmp $3 '0' digit 38 | IntCmp $3 '0' letter letter digit 39 | 40 | dot: 41 | StrCmp $7 'dot' replacespecial 42 | StrCpy $7 'dot' 43 | goto preloop 44 | 45 | digit: 46 | StrCmp $7 'letter' insertdot 47 | StrCpy $7 'digit' 48 | goto preloop 49 | 50 | letter: 51 | StrCpy $5 0 52 | StrCpy $4 $1 1 $5 53 | IntOp $5 $5 + 1 54 | StrCmp $4 '' replacespecial 55 | StrCmp $4 $3 0 -3 56 | IntCmp $5 9 0 0 +2 57 | StrCpy $5 '0$5' 58 | 59 | StrCmp $7 'letter' +2 60 | StrCmp $7 'dot' 0 +3 61 | StrCpy $6 '' 62 | goto +2 63 | StrCpy $6 '.' 64 | 65 | StrCpy $4 $0 $2 66 | IntOp $2 $2 + 1 67 | StrCpy $0 $0 '' $2 68 | StrCpy $0 '$4$6$5$0' 69 | StrLen $4 '$6$5' 70 | IntOp $2 $2 + $4 71 | IntOp $2 $2 - 1 72 | StrCpy $7 'letter' 73 | goto loop 74 | 75 | replacespecial: 76 | StrCmp $7 'dot' 0 +3 77 | StrCpy $6 '' 78 | goto +2 79 | StrCpy $6 '.' 80 | 81 | StrCpy $4 $0 $2 82 | IntOp $2 $2 + 1 83 | StrCpy $0 $0 '' $2 84 | StrCpy $0 '$4$6$0' 85 | StrLen $4 $6 86 | IntOp $2 $2 + $4 87 | IntOp $2 $2 - 1 88 | StrCpy $7 'dot' 89 | goto loop 90 | 91 | insertdot: 92 | StrCpy $4 $0 $2 93 | StrCpy $0 $0 '' $2 94 | StrCpy $0 '$4.$0' 95 | StrCpy $7 'dot' 96 | goto preloop 97 | 98 | endcheck: 99 | StrCpy $4 $0 1 -1 100 | StrCmp $4 '.' 0 end 101 | StrCpy $0 $0 -1 102 | goto -3 103 | 104 | end: 105 | Pop $7 106 | Pop $6 107 | Pop $5 108 | Pop $4 109 | Pop $3 110 | Pop $2 111 | Pop $1 112 | Exch $0 113 | FunctionEnd -------------------------------------------------------------------------------- /include/Plugins/RealProgress.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/include/Plugins/RealProgress.dll -------------------------------------------------------------------------------- /include/Plugins/inetc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/include/Plugins/inetc.dll -------------------------------------------------------------------------------- /include/Plugins/locate.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/include/Plugins/locate.dll -------------------------------------------------------------------------------- /include/Plugins/nsisunz.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/include/Plugins/nsisunz.dll -------------------------------------------------------------------------------- /include/Plugins/time.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/include/Plugins/time.dll -------------------------------------------------------------------------------- /releases/nquake29_installer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/releases/nquake29_installer.exe -------------------------------------------------------------------------------- /releases/nquake_installer-latest.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/releases/nquake_installer-latest.exe -------------------------------------------------------------------------------- /src/addons.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=7 3 | 4 | [Field 1] 5 | Type=Label 6 | Top=0 7 | Left=0 8 | Right=300 9 | Bottom=10 10 | Text=Please select which addons to install. Click Next to continue. 11 | 12 | [Field 2] 13 | Type=GroupBox 14 | Top=12 15 | Left=0 16 | Right=145 17 | Bottom=48 18 | Text=Modifications 19 | 20 | [Field 3] 21 | Type=CheckBox 22 | Top=22 23 | Left=10 24 | Right=135 25 | Bottom=32 26 | Text=Team Fortress 27 | State=1 28 | 29 | [Field 4] 30 | Type=CheckBox 31 | Top=32 32 | Left=10 33 | Right=135 34 | Bottom=42 35 | Text=Clan Arena 36 | State=1 37 | 38 | [Field 5] 39 | Type=GroupBox 40 | Top=12 41 | Left=155 42 | Right=300 43 | Bottom=59 44 | Text=Addons 45 | 46 | [Field 6] 47 | Type=CheckBox 48 | Top=22 49 | Left=165 50 | Right=290 51 | Bottom=32 52 | Text=High resolution textures 53 | State=0 54 | 55 | [Field 7] 56 | Type=Label 57 | Top=36 58 | Left=165 59 | Right=290 60 | Bottom=54 61 | Text=Replaces the lossy low resolution jpeg textures in nQuake. -------------------------------------------------------------------------------- /src/association.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=3 3 | 4 | [Field 1] 5 | Type=Label 6 | Top=0 7 | Left=0 8 | Right=300 9 | Bottom=20 10 | Text=Setup can associate QuakeWorld related file types to allow double-clicking of demo files and QTV stream info files for easy spectating. Click Next to continue. 11 | 12 | [Field 2] 13 | Type=GroupBox 14 | Top=20 15 | Left=0 16 | Right=300 17 | Bottom=46 18 | Text=File association 19 | 20 | [Field 3] 21 | Type=Checkbox 22 | Top=30 23 | Left=10 24 | Right=290 25 | Bottom=40 26 | Text=Associate QuakeWorld related file types. 27 | State=0 -------------------------------------------------------------------------------- /src/config.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=17 3 | 4 | [Field 1] 5 | Type=Label 6 | Top=0 7 | Left=0 8 | Right=300 9 | Bottom=20 10 | Text=Please take the time to personalize your configuration. This step will save you a lot of time. Click Next to continue. 11 | 12 | [Field 2] 13 | Type=GroupBox 14 | Top=20 15 | Left=0 16 | Right=145 17 | Bottom=50 18 | Text=Player information 19 | 20 | [Field 3] 21 | Type=Label 22 | Top=32 23 | Left=10 24 | Right=50 25 | Bottom=42 26 | Text=Nickname 27 | 28 | [Field 4] 29 | Type=Text 30 | Top=30 31 | Left=70 32 | Right=135 33 | Bottom=44 34 | State=Player 35 | 36 | [Field 5] 37 | Type=GroupBox 38 | Top=55 39 | Left=0 40 | Right=145 41 | Bottom=85 42 | Text=Mouse settings 43 | 44 | [Field 6] 45 | Type=CheckBox 46 | Top=67 47 | Left=10 48 | Right=140 49 | Bottom=77 50 | Text=Invert mouse 51 | State=0 52 | 53 | [Field 7] 54 | Type=GroupBox 55 | Top=20 56 | Left=155 57 | Right=300 58 | Bottom=115 59 | Text=Movement keys 60 | 61 | [Field 8] 62 | Type=Label 63 | Top=32 64 | Left=165 65 | Right=200 66 | Bottom=42 67 | Text=Forward 68 | 69 | [Field 9] 70 | Type=Droplist 71 | Top=30 72 | Left=246 73 | Right=290 74 | Bottom=44 75 | State=w 76 | ListItems=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|space|shift|ctrl|alt|capslock|tab 77 | 78 | [Field 10] 79 | Type=Label 80 | Top=48 81 | Left=165 82 | Right=200 83 | Bottom=58 84 | Text=Back 85 | 86 | [Field 11] 87 | Type=Droplist 88 | Top=46 89 | Left=246 90 | Right=290 91 | Bottom=60 92 | State=s 93 | ListItems=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|space|shift|ctrl|alt|capslock|tab 94 | 95 | [Field 12] 96 | Type=Label 97 | Top=64 98 | Left=165 99 | Right=200 100 | Bottom=74 101 | Text=Moveleft 102 | 103 | [Field 13] 104 | Type=Droplist 105 | Top=62 106 | Left=246 107 | Right=290 108 | Bottom=76 109 | State=a 110 | ListItems=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|space|shift|ctrl|alt|capslock|tab 111 | 112 | [Field 14] 113 | Type=Label 114 | Top=80 115 | Left=165 116 | Right=200 117 | Bottom=90 118 | Text=Moveright 119 | 120 | [Field 15] 121 | Type=Droplist 122 | Top=78 123 | Left=246 124 | Right=290 125 | Bottom=92 126 | State=d 127 | ListItems=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|space|shift|ctrl|alt|capslock|tab 128 | 129 | [Field 16] 130 | Type=Label 131 | Top=96 132 | Left=165 133 | Right=200 134 | Bottom=106 135 | Text=Jump 136 | 137 | [Field 17] 138 | Type=Droplist 139 | Top=94 140 | Left=246 141 | Right=290 142 | Bottom=110 143 | State=space 144 | ListItems=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|space|shift|ctrl|alt|capslock|tab -------------------------------------------------------------------------------- /src/download.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=8 3 | 4 | [Field 1] 5 | Type=Label 6 | Top=0 7 | Left=0 8 | Right=290 9 | Bottom=30 10 | Text=Please select a folder where the setup files can be saved. The setup files can be used later for offline installations. You can also select a mirror close to you from the drop-down list to improve download speed. Click Next to continue. 11 | 12 | [Field 2] 13 | Type=GroupBox 14 | Top=28 15 | Left=0 16 | Right=300 17 | Bottom=65 18 | Text=Download Folder 19 | 20 | [Field 3] 21 | Type=DirRequest 22 | Top=42 23 | Left=10 24 | Right=290 25 | Bottom=55 26 | State=C:\ 27 | 28 | [Field 4] 29 | Type=CheckBox 30 | Top=70 31 | Left=0 32 | Right=300 33 | Bottom=80 34 | Text=Download updated versions of locally stored setup files. 35 | State=1 36 | 37 | [Field 5] 38 | Type=CheckBox 39 | Top=80 40 | Left=0 41 | Right=300 42 | Bottom=90 43 | Text=Download all setup files again (in case of bad local versions). 44 | State=0 45 | 46 | [Field 6] 47 | Type=CheckBox 48 | Top=90 49 | Left=0 50 | Right=300 51 | Bottom=100 52 | Text=Delete the setup files after installation has completed. 53 | State=0 54 | 55 | [Field 7] 56 | Type=GroupBox 57 | Top=104 58 | Left=0 59 | Right=300 60 | Bottom=141 61 | Text=Download Mirror 62 | 63 | [Field 8] 64 | Type=DropList 65 | ListItems=a|b|c 66 | Top=118 67 | Left=10 68 | Right=290 69 | Bottom=3000 70 | State="Randomly selected mirror (Recommended)" -------------------------------------------------------------------------------- /src/errors.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=2 3 | 4 | [Field 1] 5 | Type=Label 6 | Top=0 7 | Left=0 8 | Right=300 9 | Bottom=20 10 | Text=There were some errors during the installation of nQuake. See below for more information. 11 | 12 | [Field 2] 13 | Type=Listbox 14 | Top=25 15 | Left=0 16 | Right=300 17 | Bottom=135 18 | ListItems= 19 | Flags=MULTILINE|VSCROLL -------------------------------------------------------------------------------- /src/gnu.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 6 | 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | Preamble 10 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 11 | 12 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. 13 | 14 | To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. 15 | 16 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 17 | 18 | We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. 19 | 20 | Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. 21 | 22 | Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 23 | 24 | The precise terms and conditions for copying, distribution and modification follow. 25 | 26 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 27 | 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". 28 | 29 | Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 30 | 31 | 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 32 | 33 | You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 34 | 35 | 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 36 | 37 | 38 | a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 39 | 40 | b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 41 | 42 | c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 43 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 44 | Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. 45 | 46 | In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 47 | 48 | 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: 49 | 50 | a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 51 | 52 | b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 53 | 54 | c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 55 | The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 56 | If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 57 | 58 | 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 59 | 60 | 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 61 | 62 | 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 63 | 64 | 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. 65 | 66 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 67 | 68 | It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 69 | 70 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 71 | 72 | 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 73 | 74 | 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 75 | 76 | Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 77 | 78 | 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 79 | 80 | NO WARRANTY 81 | 82 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 83 | 84 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 85 | 86 | 87 | END OF TERMS AND CONDITIONS 88 | -------------------------------------------------------------------------------- /src/license.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 6 | 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | Preamble 10 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 11 | 12 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. 13 | 14 | To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. 15 | 16 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 17 | 18 | We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. 19 | 20 | Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. 21 | 22 | Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 23 | 24 | The precise terms and conditions for copying, distribution and modification follow. 25 | 26 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 27 | 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". 28 | 29 | Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 30 | 31 | 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 32 | 33 | You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 34 | 35 | 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 36 | 37 | 38 | a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 39 | 40 | b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 41 | 42 | c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 43 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 44 | Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. 45 | 46 | In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 47 | 48 | 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: 49 | 50 | a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 51 | 52 | b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 53 | 54 | c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 55 | The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 56 | If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 57 | 58 | 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 59 | 60 | 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 61 | 62 | 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 63 | 64 | 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. 65 | 66 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 67 | 68 | It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 69 | 70 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 71 | 72 | 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 73 | 74 | 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 75 | 76 | Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 77 | 78 | 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 79 | 80 | NO WARRANTY 81 | 82 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 83 | 84 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 85 | 86 | 87 | END OF TERMS AND CONDITIONS 88 | 89 | 90 | ---------------------------------------------------------------------------------------------------------- 91 | 92 | 93 | SHAREWARE VERSION: QUAKE 94 | LIMITED USE SOFTWARE LICENSE AGREEMENT 95 | 96 | This Limited Use Software License Agreement (the "Agreement") is a 97 | legal agreement between you, the end-user, and id Software, Inc. 98 | ("ID"). By continuing the installation of this game program, by 99 | loading or running the game, or by placing or copying the game 100 | program onto your computer hard drive, you are agreeing to be bound 101 | by the terms of this Agreement. 102 | 103 | ID SOFTWARE LICENSE 104 | 105 | 1. Grant of License. ID grants to you the limited right to use 106 | one (1) copy of the enclosed or foregoing Id Software game program 107 | (the "Software"), which is the shareware version or episode one of 108 | the game program. For purposes of this section, "use" means loading 109 | the Software into RAM, as well as installation on a hard disk or 110 | other storage device. You agree that the Software will not be 111 | shipped, transferred or exported into any country in violation of 112 | the U.S. Export Administration Act (or any other law governing such 113 | matters) and that you will not utilize, in any other manner, the 114 | Software in violation of any applicable law. 115 | 116 | 2. Commercial Use is Prohibited. Under no circumstances shall 117 | you, the end-user, be permitted, allowed or authorized to 118 | commercially exploit the Software, or any portion thereof, such 119 | as a screen display or a screenshot. Neither you nor anyone at your 120 | direction shall do any of the following acts: 121 | 122 | a. Rent the Software; 123 | 124 | b. Sell the Software; 125 | 126 | c. Lease or lend the Software; 127 | 128 | d. Offer the Software on a pay-per-play basis; 129 | 130 | e. Distribute the Software for money or any other 131 | consideration; or 132 | 133 | f. In any other manner and through any medium 134 | whatsoever commercially exploit the Software or use 135 | the Software for any commercial purpose. 136 | 137 | 3. Additional Prohibited Uses. Neither you, nor anyone at your 138 | direction, shall take the following action in regard to the 139 | Software, or any portion thereof, such as a screen display or 140 | a screenshot: 141 | 142 | a. Modify, disassemble, reverse engineer or decompile 143 | the Software; 144 | 145 | b. Translate the Software; 146 | 147 | c. Reproduce the Software; 148 | 149 | d. Publicly display the Software; or 150 | 151 | e. Prepare derivative works based upon the Software. 152 | 153 | 4. Use of Other Material is Prohibited. Use, in any manner, of 154 | the trademarks, such as Quake(tm) and the NIN(r) logo, logos, symbols, 155 | art work, images, screen displays or screenshots, sound effects, music, 156 | and other such material contained within, generated by or relating to 157 | the Software is prohibited. 158 | 159 | 5. Restrictions Apply to Third Parties. The prohibitions and 160 | restrictions described herein apply to anyone in possession of 161 | the Software. 162 | 163 | 6. Permitted Distribution. So long as this Agreement 164 | accompanies the Software at all times, ID grants to Providers the 165 | limited right to distribute, free of charge, except normal access 166 | fees, and by electronic means only, the Software; provided, however, 167 | the Software must be so electronically distributed only in a 168 | compressed format. The term "Providers," as used in the foregoing 169 | sentence, shall mean persons whose business it is to provide 170 | services on the Internet, on commercial online networks, or on the 171 | BBS. Anyone who receives the Software from a Provider shall be 172 | limited to all the terms and conditions of this Agreement. Further, 173 | ID grants to you, the end-user, the limited right to distribute, 174 | free of charge only, the Software as a whole. 175 | 176 | 7. Copyright. The Software is owned by ID and is protected by 177 | United States copyright laws and international treaty provisions. 178 | You must treat the Software like any other copyrighted material, 179 | except that you may make copies of the Software to give to other 180 | persons. You may not charge or receive any consideration from any 181 | other person for the receipt or use of the Software. You agree to 182 | use your best efforts to see that any user of the Software licensed 183 | hereunder complies with this Agreement. 184 | 185 | 8. Limited Warranty. ID warrants that if properly installed and 186 | operated on a computer for which it is designed, the Software will 187 | perform substantially in accordance with its designed purpose for a 188 | period of ninety (90) days from the date the Software is first 189 | obtained by an end-user. ID's entire liability and your exclusive 190 | remedy shall be, at ID's option, either (a) return of the retail 191 | price paid, if any, or (b) repair or replacement of the Software 192 | that does not meet ID's Limited Warranty. To make a warranty claim, 193 | return the Software to the point of purchase, accompanied by proof 194 | of purchase, your name, your address, and a statement of defect, or 195 | return the Software with the above information to ID. This Limited 196 | Warranty is void if failure of the Software has resulted in whole 197 | or in part from accident, abuse, misapplication or violation of this 198 | Agreement. Any replacement Software will be warranted for the 199 | remainder of the original warranty period or thirty (30) days, 200 | whichever is longer. This warranty allocates risks of product 201 | failure between Licensee and ID. ID's product pricing reflects this 202 | allocation of risk and the limitations of liability contained in 203 | this warranty. 204 | 205 | 9. NO OTHER WARRANTIES. ID DISCLAIMS ALL OTHER WARRANTIES, 206 | EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED 207 | WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A pARTICULAR PURPOSE 208 | WITH RESPECT TO THE SOFTWARE AND THE ACCOMPANYING WRITTEN MATERIALS, 209 | IF ANY. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU 210 | MAY HAVE OTHERS WHICH VARY FROM JURISDICTION TO JURISDICTION. ID 211 | DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE WILL BE 212 | UNINTERRUPTED, ERROR FREE OR MEET LICENSEE'S SPECIFIC REQUIREMENTS. 213 | THE WARRANTY SET FORTH ABOVE IS IN LIEU OF ALL OTHER EXPRESS 214 | WARRANTIES WHETHER ORAL OR WRITTEN. THE AGENTS, EMPLOYEES, 215 | DISTRIBUTORS, AND DEALERS OF ID ARE NOT AUTHORIZED TO MAKE 216 | MODIFICATIONS TO THIS WARRANTY, OR ADDITIONAL WARRANTIES ON BEHALF 217 | OF ID. ADDITIONAL STATEMENTS SUCH AS DEALER ADVERTISING OR 218 | PRESENTATIONS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES 219 | BY ID AND SHOULD NOT BE RELIED UPON. 220 | 221 | 10. Exclusive Remedies. You agree that your exclusive remedy 222 | against ID, its affiliates, contractors, suppliers, and agents for 223 | loss or damage caused by any defect or failure in the Software 224 | regardless of the form of action, whether in contract,tort, 225 | including negligence, strict liability or otherwise, shall be the 226 | return of the retail purchase price paid, if any, or replacement of 227 | the Software. This Agreement shall be construed in accordance with 228 | and governed by the laws of the State of Texas. Copyright and other 229 | proprietary matters will be governed by United States laws and 230 | international treaties. IN ANY CASE, ID SHALL NOT BE LIABLE FOR LOSS 231 | OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, 232 | CONSEQUENTIAL, INDIRECT OR OTHER SIMILAR DAMAGES ARISING FROM BREACH 233 | OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, OR OTHER LEGAL THEORY 234 | EVEN IF ID OR ITS AGENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 235 | DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do 236 | not allow the exclusion or limitation of incidental or consequential 237 | damages, so the above limitation or exclusion may not apply to you. 238 | 239 | 11. General Provisions. Neither this Agreement nor any part or 240 | portion hereof shall be assigned or sublicensed, except as described 241 | herein. Should any provision of this Agreement be held to be void, 242 | invalid, unenforceable or illegal by a court, the validity and 243 | enforceability of the other provisions shall not be affected thereby. 244 | If any provision is determined to be unenforceable, you agree to a 245 | modification of such provision to provide for enforcement of the 246 | provision's intent, to the extent permitted by applicable law. Failure 247 | of a party to enforce any provision of this Agreement shall not 248 | constitute or be construed as a waiver of such provision or of the 249 | right to enforce such provision. If you fail to comply with any terms 250 | of this Agreement, YOUR LICENSE IS AUTOMATICALLY TERMINATED. 251 | 252 | YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, YOU UNDERSTAND 253 | THIS AGREEMENT, AND UNDERSTAND THAT BY CONTINUING THE INSTALLATION 254 | OF THE SOFTWARE, BY LOADING OR RUNNING THE SOFTWARE, OR BY PLACING 255 | OR COPYING THE SOFTWARE ONTO YOUR COMPUTER HARD DRIVE, YOU AGREE TO 256 | BE BOUND BY THIS AGREEMENT'S TERMS AND CONDITIONS. YOU FURTHER 257 | AGREE THAT, EXCEPT FOR WRITTEN SEPARATE AGREEMENTS BETWEEN ID AND 258 | YOU, THIS AGREEMENT IS A COMPLETE AND EXCLUSIVE STATEMENT OF THE 259 | RIGHTS AND LIABILITIES OF THE PARTIES. THIS AGREEMENT SUPERSEDES 260 | ALL PRIOR ORAL AGREEMENTS, PROPOSALS OR UNDERSTANDINGS, AND ANY 261 | OTHER COMMUNICATIONS BETWEEN ID AND YOU RELATING TO THE SUBJECT 262 | MATTER OF THIS AGREEMENT. 263 | 264 | June 21, 1996 265 | 266 | SHAREWARE VERSION: QUAKE LIMITED USE SOFTWARE LICENSE AGREEMENT 267 | (DWC:dw:3406.0024:DWC\doc:1163) 268 | 269 | 270 | ---------------------------------------------------------------------------------------------------------- 271 | 272 | 273 | QIZMO IS SUPPLIED AS IS. THE AUTHORS DISCLAIM ALL WARRANTIES, 274 | EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES 275 | OF MERCHANTABILITY AND OF FITNESS FOR ANY PURPOSE. THE AUTHORS ASSUME 276 | NO LIABILITY FOR DAMAGES, DIRECT OR CONSEQUENTIAL, WHICH MAY RESULT 277 | FROM THE USE OF QIZMO. -------------------------------------------------------------------------------- /src/nquake-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/src/nquake-header.bmp -------------------------------------------------------------------------------- /src/nquake-installer_source.nsi: -------------------------------------------------------------------------------- 1 | ;nQuake NSIS Online Installer Script 2 | ;By Empezar 2007-05-31; Last modified 2016-07-028 3 | 4 | !define VERSION "2.9" 5 | !define SHORTVERSION "29" 6 | 7 | Name "nQuake" 8 | OutFile "nquake_installer-latest.exe" 9 | InstallDir "C:\nQuake" 10 | 11 | !define NQUAKE_URL "http://nquake.com" # Note: no trailing slash! 12 | !define NQUAKE_INI_URL "https://raw.githubusercontent.com/nQuake/client-win32/master/etc/nquake.ini" 13 | !define DISTFILES_PATH "$LOCALAPPDATA\nQuake\" # Note: no trailing slash! 14 | 15 | # Editing anything below this line is not recommended 16 | ;--------------------------------------------------- 17 | 18 | InstallDirRegKey HKCU "Software\nQuake" "Install_Dir" 19 | InstallDirRegKey HKCU "Software\nQuake" "Setup_Dir" 20 | 21 | ;---------------------------------------------------- 22 | ;Header Files 23 | 24 | !include "MUI.nsh" 25 | !include "Win\WinUser.nsh" 26 | !include "FileAssociation.nsh" 27 | !include "FileFunc.nsh" 28 | !insertmacro GetSize 29 | !insertmacro GetTime 30 | !include "LogicLib.nsh" 31 | !include "Time.nsh" 32 | !include "Locate.nsh" 33 | !include "VersionCompare.nsh" 34 | !include "VersionConvert.nsh" 35 | !include "WinMessages.nsh" 36 | !include "MultiUser.nsh" 37 | !include "nquake-macros.nsh" 38 | 39 | ;---------------------------------------------------- 40 | ;Variables 41 | 42 | Var ADDON_CLANARENA 43 | Var ADDON_FORTRESS 44 | Var ADDON_TEXTURES 45 | Var ASSOCIATE_FILES 46 | Var CONFIG_NAME 47 | Var CONFIG_INVERT 48 | Var CONFIG_FORWARD 49 | Var CONFIG_BACK 50 | Var CONFIG_MOVELEFT 51 | Var CONFIG_MOVERIGHT 52 | Var CONFIG_JUMP 53 | Var CONFIGCFG 54 | Var DISTFILES_DELETE 55 | Var DISTFILES_PATH 56 | Var DISTFILES_REDOWNLOAD 57 | Var DISTFILES_UPDATE 58 | Var DISTFILES_URL 59 | Var DISTFILES 60 | Var DISTLOG 61 | Var DISTLOGTMP 62 | Var ERRLOG 63 | Var ERRLOGTMP 64 | Var ERRORS 65 | Var INSTALLED 66 | Var INSTLOG 67 | Var INSTLOGTMP 68 | Var INSTSIZE 69 | Var NQUAKE_INI 70 | Var OFFLINE 71 | Var REMOVE_ALL_FILES 72 | Var REMOVE_MODIFIED_FILES 73 | Var REMOVE_SETUP_FILES 74 | Var RETRIES 75 | Var SIZE 76 | Var STARTMENU_FOLDER 77 | 78 | ;---------------------------------------------------- 79 | ;Interface Settings 80 | 81 | !define MUI_ICON "nquake.ico" 82 | !define MUI_UNICON "nquake.ico" 83 | 84 | !define MUI_WELCOMEFINISHPAGE_BITMAP "nquake-welcomefinish.bmp" 85 | 86 | !define MUI_HEADERIMAGE 87 | !define MUI_HEADERIMAGE_BITMAP "nquake-header.bmp" 88 | 89 | !define MULTIUSER_EXECUTIONLEVEL Highest 90 | 91 | ;---------------------------------------------------- 92 | ;Installer Pages 93 | 94 | !define MUI_PAGE_CUSTOMFUNCTION_PRE "WelcomeShow" 95 | !define MUI_WELCOMEPAGE_TITLE "nQuake Installation Wizard" 96 | !insertmacro MUI_PAGE_WELCOME 97 | 98 | LicenseForceSelection checkbox "I agree to these terms and conditions" 99 | !insertmacro MUI_PAGE_LICENSE "license.txt" 100 | 101 | Page custom DOWNLOAD 102 | 103 | Page custom CONFIG 104 | 105 | Page custom ADDONS 106 | 107 | Page custom ASSOCIATION 108 | 109 | DirText "Setup will install nQuake in the following folder. To install in a different folder, click Browse and select another folder. Click Next to continue.$\r$\n$\r$\nIt is NOT ADVISABLE to install in the Program Files folder." "Destination Folder" "Browse" "Select the folder to install nQuake in:" 110 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryPageShow 111 | !insertmacro MUI_PAGE_DIRECTORY 112 | 113 | !insertmacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER 114 | 115 | ShowInstDetails "nevershow" 116 | !insertmacro MUI_PAGE_INSTFILES 117 | 118 | Page custom ERRORS 119 | 120 | !define MUI_PAGE_CUSTOMFUNCTION_SHOW "FinishShow" 121 | !define MUI_FINISHPAGE_LINK "Click here to visit the QuakeWorld portal" 122 | !define MUI_FINISHPAGE_LINK_LOCATION "http://quakeworld.nu/?traffic_source=nquake_install_finish" 123 | !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR/readme.txt" 124 | !define MUI_FINISHPAGE_SHOWREADME_TEXT "Open readme" 125 | !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED 126 | !define MUI_FINISHPAGE_NOREBOOTSUPPORT 127 | !insertmacro MUI_PAGE_FINISH 128 | 129 | ;---------------------------------------------------- 130 | ;Uninstaller Pages 131 | 132 | UninstPage custom un.UNINSTALL 133 | 134 | !insertmacro MUI_UNPAGE_INSTFILES 135 | 136 | ;---------------------------------------------------- 137 | ;Languages 138 | 139 | !insertmacro MUI_LANGUAGE "English" 140 | 141 | ;---------------------------------------------------- 142 | ;NSIS Manipulation 143 | 144 | LangString ^Branding ${LANG_ENGLISH} "nQuake Installer v${VERSION}" 145 | LangString ^SetupCaption ${LANG_ENGLISH} "nQuake Installer" 146 | LangString ^SpaceRequired ${LANG_ENGLISH} "Download size: " 147 | 148 | ;---------------------------------------------------- 149 | ;Reserve Files 150 | 151 | ReserveFile "config.ini" 152 | ReserveFile "download.ini" 153 | ReserveFile "addons.ini" 154 | ReserveFile "association.ini" 155 | ReserveFile "errors.ini" 156 | ReserveFile "uninstall.ini" 157 | 158 | !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS 159 | 160 | ;---------------------------------------------------- 161 | ;Installer Sections 162 | 163 | Section "" # Prepare installation 164 | 165 | SetOutPath $INSTDIR 166 | 167 | # Set progress bar 168 | RealProgress::SetProgress /NOUNLOAD 0 169 | 170 | # Read information from custom pages 171 | !insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_PATH "download.ini" "Field 3" "State" 172 | !insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_UPDATE "download.ini" "Field 4" "State" 173 | !insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_REDOWNLOAD "download.ini" "Field 5" "State" 174 | !insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_DELETE "download.ini" "Field 6" "State" 175 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_NAME "config.ini" "Field 4" "State" 176 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_INVERT "config.ini" "Field 6" "State" 177 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_FORWARD "config.ini" "Field 9" "State" 178 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_BACK "config.ini" "Field 11" "State" 179 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_MOVELEFT "config.ini" "Field 13" "State" 180 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_MOVERIGHT "config.ini" "Field 15" "State" 181 | !insertmacro MUI_INSTALLOPTIONS_READ $CONFIG_JUMP "config.ini" "Field 17" "State" 182 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_FORTRESS "addons.ini" "Field 3" "State" 183 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_CLANARENA "addons.ini" "Field 4" "State" 184 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 6" "State" 185 | !insertmacro MUI_INSTALLOPTIONS_READ $ASSOCIATE_FILES "association.ini" "Field 3" "State" 186 | 187 | # Create distfiles folder if it doesn't already exist 188 | ${Unless} ${FileExists} "$DISTFILES_PATH\*.*" 189 | CreateDirectory $DISTFILES_PATH 190 | ${EndUnless} 191 | 192 | # Calculate the installation size 193 | ${Unless} ${FileExists} "$INSTDIR\ID1\PAK0.PAK" 194 | ${OrUnless} ${FileExists} "$EXEDIR\pak0.pak" 195 | ${OrUnless} ${FileExists} "$DISTFILES_PATH\pak0.pak" 196 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "qsw106.zip" 197 | IntOp $INSTSIZE $INSTSIZE + $0 198 | ${EndUnless} 199 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "gpl.zip" 200 | IntOp $INSTSIZE $INSTSIZE + $0 201 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "non-gpl.zip" 202 | IntOp $INSTSIZE $INSTSIZE + $0 203 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip" 204 | IntOp $INSTSIZE $INSTSIZE + $0 205 | ${If} $ADDON_FORTRESS == 1 206 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-fortress.zip" 207 | IntOp $INSTSIZE $INSTSIZE + $0 208 | ${EndIf} 209 | ${If} $ADDON_CLANARENA == 1 210 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-clanarena.zip" 211 | IntOp $INSTSIZE $INSTSIZE + $0 212 | ${EndIf} 213 | ${If} $ADDON_TEXTURES == 1 214 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-textures.zip" 215 | IntOp $INSTSIZE $INSTSIZE + $0 216 | ${EndIf} 217 | 218 | # Find out what mirror was selected 219 | !insertmacro MUI_INSTALLOPTIONS_READ $R0 "download.ini" "Field 8" "State" 220 | ${If} $R0 == "Randomly selected mirror (Recommended)" 221 | # Get amount of mirrors ($0 = amount of mirrors) 222 | StrCpy $0 1 223 | ReadINIStr $1 $NQUAKE_INI "mirror_descriptions" $0 224 | ${DoUntil} $1 == "" 225 | ReadINIStr $1 $NQUAKE_INI "mirror_descriptions" $0 226 | IntOp $0 $0 + 1 227 | ${LoopUntil} $1 == "" 228 | IntOp $0 $0 - 2 229 | 230 | # Get time (seconds) 231 | ${time::GetLocalTime} $1 232 | StrCpy $1 $1 "" -2 233 | 234 | # Fix seconds (00 -> 1, 01-09 -> 1-9) 235 | ${If} $1 == "00" 236 | StrCpy $1 1 237 | ${Else} 238 | StrCpy $2 $1 1 -2 239 | ${If} $2 == 0 240 | StrCpy $1 $1 1 -1 241 | ${EndIf} 242 | ${EndIf} 243 | 244 | # Loop until you get a number that's within the range 0 < x =< $0 245 | ${DoUntil} $1 <= $0 246 | IntOp $1 $1 - $0 247 | ${LoopUntil} $1 <= $0 248 | ReadINIStr $DISTFILES_URL $NQUAKE_INI "mirror_addresses" $1 249 | ReadINIStr $0 $NQUAKE_INI "mirror_descriptions" $1 250 | ${Else} 251 | ${For} $0 1 1000 252 | ReadINIStr $R1 $NQUAKE_INI "mirror_descriptions" $0 253 | ${If} $R0 == $R1 254 | ReadINIStr $DISTFILES_URL $NQUAKE_INI "mirror_addresses" $0 255 | ReadINIStr $0 $NQUAKE_INI "mirror_descriptions" $0 256 | ${ExitFor} 257 | ${EndIf} 258 | ${Next} 259 | ${EndIf} 260 | 261 | # Open temporary files 262 | GetTempFileName $INSTLOGTMP 263 | GetTempFileName $DISTLOGTMP 264 | GetTempFileName $ERRLOGTMP 265 | FileOpen $INSTLOG $INSTLOGTMP w 266 | FileOpen $DISTLOG $DISTLOGTMP w 267 | FileOpen $ERRLOG $ERRLOGTMP a 268 | 269 | SectionEnd 270 | 271 | Section "nQuake" NQUAKE 272 | 273 | # Download and install pak0.pak (shareware data) unless pak0.pak can be found alongside the installer executable 274 | ${If} ${FileExists} "$EXEDIR\pak0.pak" 275 | StrCpy $R0 "$EXEDIR" 276 | ${ElseIf} ${FileExists} "$DISTFILES_PATH\pak0.pak" 277 | StrCpy $R0 "$DISTFILES_PATH" 278 | ${EndIf} 279 | ${GetSize} $R0 "/M=pak0.pak /S=0B /G=0" $7 $8 $9 280 | ${If} $7 == "18689235" 281 | CreateDirectory "$INSTDIR\id1" 282 | ${Unless} ${FileExists} "$INSTDIR\id1\pak0.pak" 283 | CopyFiles /SILENT "$R0\pak0.pak" "$INSTDIR\id1\pak0.pak" 284 | ${EndUnless} 285 | # Keep pak0.pak and remove qsw106.zip in distfile folder if DISTFILES_DELETE is 0 286 | ${If} $DISTFILES_DELETE == 0 287 | ${Unless} ${FileExists} "$DISTFILES_PATH\pak0.pak" 288 | CopyFiles /SILENT "$INSTDIR\id1\pak0.pak" "$DISTFILES_PATH\pak0.pak" 289 | ${EndUnless} 290 | Delete "$DISTFILES_PATH\qsw106.zip" 291 | ${EndIf} 292 | FileWrite $INSTLOG "id1\pak0.pak$\r$\n" 293 | Goto SkipShareware 294 | ${EndIf} 295 | !insertmacro InstallSection qsw106.zip "Quake shareware" 296 | # Remove crap files extracted from shareware zip and rename uppercase files/folders 297 | Delete "$INSTDIR\CWSDPMI.EXE" 298 | Delete "$INSTDIR\QLAUNCH.EXE" 299 | Delete "$INSTDIR\QUAKE.EXE" 300 | Delete "$INSTDIR\GENVXD.DLL" 301 | Delete "$INSTDIR\QUAKEUDP.DLL" 302 | Delete "$INSTDIR\PDIPX.COM" 303 | Delete "$INSTDIR\Q95.BAT" 304 | Delete "$INSTDIR\COMEXP.TXT" 305 | Delete "$INSTDIR\HELP.TXT" 306 | Delete "$INSTDIR\LICINFO.TXT" 307 | Delete "$INSTDIR\MANUAL.TXT" 308 | Delete "$INSTDIR\ORDER.TXT" 309 | Delete "$INSTDIR\README.TXT" 310 | Delete "$INSTDIR\READV106.TXT" 311 | Delete "$INSTDIR\SLICNSE.TXT" 312 | Delete "$INSTDIR\TECHINFO.TXT" 313 | Delete "$INSTDIR\MGENVXD.VXD" 314 | Rename "$INSTDIR\ID1" "$INSTDIR\id1" 315 | Rename "$INSTDIR\id1\PAK0.PAK" "$INSTDIR\id1\pak0.pak" 316 | # Keep pak0.pak and remove qsw106.zip in distfile folder if DISTFILES_DELETE is 0 317 | ${If} $DISTFILES_DELETE == 0 318 | ${Unless} ${FileExists} "$DISTFILES_PATH\pak0.pak" 319 | CopyFiles /SILENT "$INSTDIR\id1\pak0.pak" "$DISTFILES_PATH\pak0.pak" 320 | ${EndUnless} 321 | Delete "$DISTFILES_PATH\qsw106.zip" 322 | ${EndIf} 323 | SkipShareware: 324 | # Add to installed size 325 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "qsw106.zip" 326 | IntOp $INSTALLED $INSTALLED + $0 327 | # Set progress bar 328 | IntOp $0 $INSTALLED * 100 329 | IntOp $0 $0 / $INSTSIZE 330 | RealProgress::SetProgress /NOUNLOAD $0 331 | 332 | # Backup old configs if such exist 333 | ${If} ${FileExists} "$INSTDIR\ezquake\configs\config.cfg" 334 | ${GetTime} "" "LS" $2 $3 $4 $5 $6 $7 $8 335 | # Fix hour format 336 | ${If} $6 < 10 337 | StrCpy $6 "0$6" 338 | ${EndIf} 339 | StrCpy $1 "$4$3$2$6$7$8" 340 | Rename "$INSTDIR\ezquake\configs\config.cfg" "$INSTDIR\ezquake\configs\config-$1.cfg" 341 | ${EndIf} 342 | 343 | # Download and install GPL files 344 | !insertmacro InstallSection gpl.zip "nQuake setup files (1 of 2)" 345 | # Add to installed size 346 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "gpl.zip" 347 | IntOp $INSTALLED $INSTALLED + $0 348 | # Set progress bar 349 | IntOp $0 $INSTALLED * 100 350 | IntOp $0 $0 / $INSTSIZE 351 | RealProgress::SetProgress /NOUNLOAD $0 352 | 353 | # Download and install non-GPL files 354 | !insertmacro InstallSection non-gpl.zip "nQuake setup files (2 of 2)" 355 | # Add to installed size 356 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "non-gpl.zip" 357 | IntOp $INSTALLED $INSTALLED + $0 358 | # Set progress bar 359 | IntOp $0 $INSTALLED * 100 360 | IntOp $0 $0 / $INSTSIZE 361 | RealProgress::SetProgress /NOUNLOAD $0 362 | 363 | # Download and install textures 364 | !insertmacro InstallSection textures.zip "nQuake textures" 365 | # Add to installed size 366 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "textures.zip" 367 | IntOp $INSTALLED $INSTALLED + $0 368 | # Set progress bar 369 | IntOp $0 $INSTALLED * 100 370 | IntOp $0 $0 / $INSTSIZE 371 | RealProgress::SetProgress /NOUNLOAD $0 372 | 373 | # Download and install Team Fortress if selected 374 | ${If} $ADDON_FORTRESS == 1 375 | !insertmacro InstallSection addon-fortress.zip "Team Fortress" 376 | # Add to installed size 377 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-fortress.zip" 378 | IntOp $INSTALLED $INSTALLED + $0 379 | # Set progress bar 380 | IntOp $0 $INSTALLED * 100 381 | IntOp $0 $0 / $INSTSIZE 382 | RealProgress::SetProgress /NOUNLOAD $0 383 | ${EndIf} 384 | 385 | # Download and install Clan Arena if selected 386 | ${If} $ADDON_CLANARENA == 1 387 | !insertmacro InstallSection addon-clanarena.zip "Clan Arena" 388 | # Add to installed size 389 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-clanarena.zip" 390 | IntOp $INSTALLED $INSTALLED + $0 391 | # Set progress bar 392 | IntOp $0 $INSTALLED * 100 393 | IntOp $0 $0 / $INSTSIZE 394 | RealProgress::SetProgress /NOUNLOAD $0 395 | ${EndIf} 396 | 397 | # Download and install high resolution textures if selected 398 | ${If} $ADDON_TEXTURES == 1 399 | !insertmacro InstallSection addon-textures.zip "High resolution textures" 400 | # Add to installed size 401 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" "addon-textures.zip" 402 | IntOp $INSTALLED $INSTALLED + $0 403 | # Set progress bar 404 | IntOp $0 $INSTALLED * 100 405 | IntOp $0 $0 / $INSTSIZE 406 | RealProgress::SetProgress /NOUNLOAD $0 407 | ${EndIf} 408 | 409 | # Copy pak1.pak if it can be found alongside the installer executable 410 | ${If} ${FileExists} "$EXEDIR\pak1.pak" 411 | StrCpy $R0 "$EXEDIR" 412 | ${ElseIf} ${FileExists} "$DISTFILES_PATH\pak1.pak" 413 | StrCpy $R0 "$DISTFILES_PATH" 414 | ${EndIf} 415 | ${GetSize} "$R0" "/M=pak1.pak /S=0B /G=0" $7 $8 $9 416 | ${If} $7 == "34257856" 417 | ${Unless} ${FileExists} "$INSTDIR\id1\pak1.pak" 418 | CopyFiles /SILENT "$R0\pak1.pak" "$INSTDIR\id1\pak1.pak" 419 | ${EndUnless} 420 | ${If} $DISTFILES_DELETE == 0 421 | ${AndIf} $R0 != $DISTFILES_PATH 422 | ${Unless} ${FileExists} "$DISTFILES_PATH\pak1.pak" 423 | CopyFiles /SILENT "$R0\pak1.pak" "$DISTFILES_PATH\pak1.pak" 424 | ${EndUnless} 425 | ${EndIf} 426 | FileWrite $INSTLOG "id1\pak1.pak$\r$\n" 427 | # Remove gpl maps also 428 | Delete "$INSTDIR\id1\gpl_maps.pk3" 429 | Delete "$INSTDIR\id1\readme.txt" 430 | ${EndIf} 431 | 432 | SectionEnd 433 | 434 | Section "" # StartMenu 435 | 436 | # Copy the first char of the startmenu folder selected during installation 437 | StrCpy $0 $STARTMENU_FOLDER 1 438 | 439 | ${Unless} $0 == ">" 440 | CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" 441 | 442 | # Create links 443 | CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER\Links" 444 | WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\Links\Latest News.url" "InternetShortcut" "URL" "http://www.quakeworld.nu/" 445 | WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\Links\Message Board.url" "InternetShortcut" "URL" "http://www.quakeworld.nu/forum/" 446 | WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\Links\List of Servers.url" "InternetShortcut" "URL" "http://www.quakeservers.net/quakeworld/servers/pl=1/so=8/" 447 | WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\Links\Chat.url" "InternetShortcut" "URL" "http://discord.quake.world" 448 | WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\Links\Custom Graphics.url" "InternetShortcut" "URL" "http://gfx.quakeworld.nu/" 449 | 450 | # Create shortcuts 451 | CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Play QuakeWorld.lnk" "$INSTDIR\ezquake.exe" "" "$INSTDIR\ezquake.exe" 0 452 | CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Readme.lnk" "$INSTDIR\readme.txt" "" "$INSTDIR\readme.txt" 0 453 | CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall nQuake.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 454 | 455 | # Write startmenu folder to registry 456 | WriteRegStr HKCU "Software\nQuake" "StartMenu_Folder" $STARTMENU_FOLDER 457 | ${EndUnless} 458 | 459 | SectionEnd 460 | 461 | Section "" # Clean up installation 462 | 463 | # Write config.cfgs for each mod 464 | CreateDirectory "$INSTDIR\ezquake\configs" 465 | FileOpen $CONFIGCFG "$INSTDIR\ezquake\configs\preset.cfg" w 466 | # Write config to ezquake\configs\preset.cfg 467 | FileWrite $CONFIGCFG "// This config was auto generated by nQuake installer$\r$\n" 468 | FileWrite $CONFIGCFG "$\r$\n" 469 | FileWrite $CONFIGCFG "name $\"$CONFIG_NAME$\"$\r$\n" 470 | FileWrite $CONFIGCFG "$\r$\n" 471 | ${If} $CONFIG_INVERT == 1 472 | FileWrite $CONFIGCFG "m_pitch $\"-0.022$\" // invert mouse$\r$\n" 473 | ${Else} 474 | FileWrite $CONFIGCFG "m_pitch $\"0.022$\"$\r$\n" 475 | ${EndIf} 476 | FileWrite $CONFIGCFG "$\r$\n" 477 | FileWrite $CONFIGCFG "bind $CONFIG_FORWARD $\"+forward$\"$\r$\n" 478 | FileWrite $CONFIGCFG "bind $CONFIG_BACK $\"+back$\"$\r$\n" 479 | FileWrite $CONFIGCFG "bind $CONFIG_MOVELEFT $\"+moveleft$\"$\r$\n" 480 | FileWrite $CONFIGCFG "bind $CONFIG_MOVERIGHT $\"+moveright$\"$\r$\n" 481 | FileWrite $CONFIGCFG "bind $CONFIG_JUMP $\"+jump$\"$\r$\n" 482 | FileClose $CONFIGCFG 483 | FileWrite $INSTLOG "ezquake\configs\preset.cfg$\r$\n" 484 | 485 | # Close open temporary files 486 | FileClose $INSTLOG 487 | FileClose $ERRLOG 488 | FileClose $DISTLOG 489 | 490 | # Write install.log 491 | FileOpen $INSTLOG "$INSTDIR\install.log" w 492 | ${time::GetFileTime} "$INSTDIR\install.log" $0 $1 $2 493 | FileWrite $INSTLOG "Install date: $1$\r$\n" 494 | FileOpen $R0 $INSTLOGTMP r 495 | ClearErrors 496 | ${DoUntil} ${Errors} 497 | FileRead $R0 $0 498 | StrCpy $0 $0 -2 499 | ${If} ${FileExists} "$INSTDIR\$0" 500 | FileWrite $INSTLOG "$0$\r$\n" 501 | ${EndIf} 502 | ${LoopUntil} ${Errors} 503 | FileClose $R0 504 | FileClose $INSTLOG 505 | 506 | # Remove downloaded distfiles 507 | ${If} $DISTFILES_DELETE == 1 508 | FileOpen $DISTLOG $DISTLOGTMP r 509 | ${DoUntil} ${Errors} 510 | FileRead $DISTLOG $0 511 | StrCpy $0 $0 -2 512 | ${If} ${FileExists} "$DISTFILES_PATH\$0" 513 | Delete /REBOOTOK "$DISTFILES_PATH\$0" 514 | ${EndIf} 515 | ${LoopUntil} ${Errors} 516 | FileClose $DISTLOG 517 | # Remove directory if empty 518 | !insertmacro RemoveFolderIfEmpty $DISTFILES_PATH 519 | # Copy nquake.ini to the distfiles directory if "update distfiles" and "keep distfiles" was set 520 | ${ElseIf} $DISTFILES_UPDATE == 1 521 | FlushINI $NQUAKE_INI 522 | CopyFiles /SILENT $NQUAKE_INI "$DISTFILES_PATH\nquake.ini" 523 | ${EndIf} 524 | 525 | # Write to registry 526 | WriteRegStr HKCU "Software\nQuake" "Install_Dir" "$INSTDIR" 527 | WriteRegStr HKCU "Software\nQuake" "Setup_Dir" "$DISTFILES_PATH" 528 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "DisplayName" "nQuake" 529 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "DisplayVersion" "${VERSION}" 530 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "DisplayIcon" "$INSTDIR\uninstall.exe" 531 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "UninstallString" "$INSTDIR\uninstall.exe" 532 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "Publisher" "Empezar (empezar@quake.world)" 533 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "URLUpdateInfo" "https://github.com/nQuake/client-win32/tree/master/bin" 534 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "URLInfoAbout" "http://nquake.com/" 535 | WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "HelpLink" "http://www.quakeworld.nu/forum/topic/1857" 536 | WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "NoModify" "1" 537 | WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" "NoRepair" "1" 538 | 539 | # Create file associations 540 | ${If} $ASSOCIATE_FILES == 1 541 | WriteRegStr HKCU "Software\nQuake" "File_Associations" "1" 542 | ${registerExtension} "$INSTDIR\ezquake.exe" .qtv "QTV Stream Info File" 543 | ${registerExtension} "$INSTDIR\ezquake.exe" .qwz "Qizmo Demo File" 544 | ${registerExtension} "$INSTDIR\ezquake.exe" .qwd "Quakeworld Demo File" 545 | ${registerExtension} "$INSTDIR\ezquake.exe" .mvd "Multi-View Demo File" 546 | ${Else} 547 | WriteRegStr HKCU "Software\nQuake" "File_Associations" "0" 548 | ${EndIf} 549 | 550 | # Create uninstaller 551 | WriteUninstaller "uninstall.exe" 552 | 553 | SectionEnd 554 | 555 | ;---------------------------------------------------- 556 | ;Uninstaller Section 557 | 558 | Section "Uninstall" 559 | 560 | # Set out path to temporary files 561 | SetOutPath $TEMP 562 | 563 | # Read uninstall settings 564 | !insertmacro MUI_INSTALLOPTIONS_READ $REMOVE_MODIFIED_FILES "uninstall.ini" "Field 5" "State" 565 | !insertmacro MUI_INSTALLOPTIONS_READ $REMOVE_ALL_FILES "uninstall.ini" "Field 6" "State" 566 | !insertmacro MUI_INSTALLOPTIONS_READ $REMOVE_SETUP_FILES "uninstall.ini" "Field 7" "State" 567 | 568 | # Set progress bar to 0% 569 | RealProgress::SetProgress /NOUNLOAD 0 570 | 571 | # If install.log exists and user didn't check "remove all files", remove all files listed in install.log 572 | ${If} ${FileExists} "$INSTDIR\install.log" 573 | ${AndIf} $REMOVE_ALL_FILES != 1 574 | # Get line count for install.log 575 | Push "$INSTDIR\install.log" 576 | Call un.LineCount 577 | Pop $R1 # Line count 578 | IntOp $R1 $R1 - 1 # Remove the timestamp from the line count 579 | FileOpen $R0 "$INSTDIR\install.log" r 580 | # Get installation time from install.log 581 | FileRead $R0 $0 582 | StrCpy $1 $0 -2 14 583 | StrCpy $5 1 # Current line 584 | StrCpy $6 0 # Current % Progress 585 | ${DoUntil} ${Errors} 586 | FileRead $R0 $0 587 | StrCpy $0 $0 -2 588 | # Only remove file if it has not been altered since install, if the user chose to do so 589 | ${If} ${FileExists} "$INSTDIR\$0" 590 | ${AndUnless} $REMOVE_MODIFIED_FILES == 1 591 | ${time::GetFileTime} "$INSTDIR\$0" $2 $3 $4 592 | ${time::MathTime} "second($1) - second($3) =" $2 593 | ${If} $2 >= 0 594 | Delete /REBOOTOK "$INSTDIR\$0" 595 | ${EndIf} 596 | ${ElseIf} $REMOVE_MODIFIED_FILES == 1 597 | ${AndIf} ${FileExists} "$INSTDIR\$0" 598 | Delete /REBOOTOK "$INSTDIR\$0" 599 | ${EndIf} 600 | # Set progress bar 601 | IntOp $7 $5 * 100 602 | IntOp $7 $7 / $R1 603 | RealProgress::SetProgress /NOUNLOAD $7 604 | IntOp $5 $5 + 1 605 | ${LoopUntil} ${Errors} 606 | FileClose $R0 607 | Delete /REBOOTOK "$INSTDIR\install.log" 608 | Delete /REBOOTOK "$INSTDIR\uninstall.exe" 609 | ${locate::RMDirEmpty} $INSTDIR /M=*.* $0 610 | DetailPrint "Removed $0 empty directories" 611 | # Remove directory if empty 612 | !insertmacro RemoveFolderIfEmpty $INSTDIR 613 | ${Else} 614 | # Ask the user if he is sure about removing all the files contained within the nQuake directory 615 | MessageBox MB_YESNO|MB_ICONEXCLAMATION "This will remove all files contained within the nQuake directory.$\r$\n$\r$\nAre you sure?" IDNO AbortUninst 616 | RMDir /r /REBOOTOK $INSTDIR 617 | RealProgress::SetProgress /NOUNLOAD 100 618 | ${EndIf} 619 | 620 | # Remove setup files if user checked "remove setup files" 621 | ${If} $REMOVE_SETUP_FILES == 1 622 | ReadRegStr $R0 HKCU "Software\nQuake" "Setup_Dir" 623 | ${If} ${FileExists} "$R0\addon-clanarena.zip" 624 | Delete /REBOOTOK "$R0\addon-clanarena.zip" 625 | ${EndIf} 626 | ${If} ${FileExists} "$R0\addon-fortress.zip" 627 | Delete /REBOOTOK "$R0\addon-fortress.zip" 628 | ${EndIf} 629 | ${If} ${FileExists} "$R0\addon-textures.zip" 630 | Delete /REBOOTOK "$R0\addon-textures.zip" 631 | ${EndIf} 632 | ${If} ${FileExists} "$R0\gpl.zip" 633 | Delete /REBOOTOK "$R0\gpl.zip" 634 | ${EndIf} 635 | ${If} ${FileExists} "$R0\non-gpl.zip" 636 | Delete /REBOOTOK "$R0\non-gpl.zip" 637 | ${EndIf} 638 | ${If} ${FileExists} "$R0\nquake.ini" 639 | Delete /REBOOTOK "$R0\nquake.ini" 640 | ${EndIf} 641 | ${If} ${FileExists} "$R0\pak0.pak" 642 | Delete /REBOOTOK "$R0\pak0.pak" 643 | ${EndIf} 644 | ${If} ${FileExists} "$R0\textures.zip" 645 | Delete /REBOOTOK "$R0\textures.zip" 646 | ${EndIf} 647 | # Remove directory if empty 648 | ${locate::RMDirEmpty} $R0 /M=*.* $0 649 | !insertmacro RemoveFolderIfEmpty $R0 650 | ${EndIf} 651 | 652 | 653 | # Remove start menu items and registry entries if they belong to this nQuake 654 | ReadRegStr $R0 HKCU "Software\nQuake" "Install_Dir" 655 | ${If} $R0 == $INSTDIR 656 | # Remove start menu items 657 | ReadRegStr $R0 HKCU "Software\nQuake" "StartMenu_Folder" 658 | RMDir /r /REBOOTOK "$SMPROGRAMS\$R0" 659 | # Remove file associations 660 | ReadRegStr $R1 HKCU "Software\nQuake" "File_Associations" 661 | ${If} $R1 == 1 662 | ${unregisterExtension} ".qtv" "QTV Stream Info File" 663 | ${unregisterExtension} ".qwz" "Qizmo Demo File" 664 | ${unregisterExtension} ".qwd" "Quakeworld Demo File" 665 | ${unregisterExtension} ".mvd" "Multi-View Demo File" 666 | ${EndIf} 667 | DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\nQuake" 668 | DeleteRegKey HKCU "Software\nQuake" 669 | ${EndIf} 670 | 671 | Goto FinishUninst 672 | AbortUninst: 673 | Abort "Uninstallation aborted." 674 | FinishUninst: 675 | 676 | SectionEnd 677 | 678 | ;---------------------------------------------------- 679 | ;Custom Pages 680 | 681 | Function DOWNLOAD 682 | 683 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "download.ini" 684 | # Change the text on the distfile folder page if the installer is in offline mode 685 | ${If} $OFFLINE == 1 686 | !insertmacro MUI_HEADER_TEXT "Setup Files" "Select where the setup files are located." 687 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 1" "Text" "Setup will use the setup files located in the following folder. To use a different folder, click Browse and select another folder. Click Next to continue." 688 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 4" "Type" "" 689 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 4" "State" "0" 690 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 5" "Type" "" 691 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 5" "State" "0" 692 | ${Else} 693 | !insertmacro MUI_HEADER_TEXT "Setup Files" "Select the download location for the setup files." 694 | ${EndIf} 695 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 3" "State" ${DISTFILES_PATH} 696 | 697 | # Only display mirror selection if the installer is in online mode 698 | ${Unless} $OFFLINE == 1 699 | # Fix the mirrors for the Preferences page 700 | StrCpy $0 1 701 | StrCpy $2 "Randomly selected mirror (Recommended)" 702 | ReadINIStr $1 $NQUAKE_INI "mirror_descriptions" $0 703 | ${DoUntil} $1 == "" 704 | ReadINIStr $1 $NQUAKE_INI "mirror_descriptions" $0 705 | ${Unless} $1 == "" 706 | StrCpy $2 "$2|$1" 707 | ${EndUnless} 708 | IntOp $0 $0 + 1 709 | ${LoopUntil} $1 == "" 710 | 711 | StrCpy $0 $2 3 712 | ${If} $0 == "|" 713 | StrCpy $2 $2 "" 1 714 | ${EndIf} 715 | 716 | !insertmacro MUI_INSTALLOPTIONS_WRITE "download.ini" "Field 8" "ListItems" $2 717 | ${EndUnless} 718 | 719 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "download.ini" 720 | 721 | FunctionEnd 722 | 723 | Function CONFIG 724 | 725 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "config.ini" 726 | !insertmacro MUI_HEADER_TEXT "Configuration" "Setup basic configuration." 727 | System::Call "advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2" 728 | !insertmacro MUI_INSTALLOPTIONS_WRITE "config.ini" "Field 4" "State" "$0" 729 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "config.ini" 730 | 731 | FunctionEnd 732 | 733 | Function ADDONS 734 | 735 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "addons.ini" 736 | !insertmacro MUI_HEADER_TEXT "Addons" "Choose what modifications and addons to install" 737 | !insertmacro DetermineSectionSize addon-fortress.zip 738 | IntOp $1 $SIZE / 1000 739 | !insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 3" "Text" "Team Fortress ($1 MB)" 740 | !insertmacro DetermineSectionSize addon-clanarena.zip 741 | IntOp $1 $SIZE / 1000 742 | !insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 4" "Text" "Clan Arena ($1 MB)" 743 | !insertmacro DetermineSectionSize addon-textures.zip 744 | IntOp $1 $SIZE / 1000 745 | !insertmacro MUI_INSTALLOPTIONS_WRITE "addons.ini" "Field 6" "Text" "High resolution textures ($1 MB)" 746 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "addons.ini" 747 | 748 | FunctionEnd 749 | 750 | Function ASSOCIATION 751 | 752 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "association.ini" 753 | !insertmacro MUI_HEADER_TEXT "File Association" "Select whether you want to associate QuakeWorld files or not." 754 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "association.ini" 755 | 756 | FunctionEnd 757 | 758 | Function ERRORS 759 | 760 | # Only display error page if errors occured during installation 761 | ${If} $ERRORS > 0 762 | # Read errors from error log 763 | StrCpy $1 "" 764 | FileOpen $R0 $ERRLOGTMP r 765 | ClearErrors 766 | FileRead $R0 $0 767 | StrCpy $1 $0 768 | ${DoUntil} ${Errors} 769 | FileRead $R0 $0 770 | ${Unless} $0 == "" 771 | StrCpy $1 "$1|$0" 772 | ${EndUnless} 773 | ${LoopUntil} ${Errors} 774 | FileClose $R0 775 | 776 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "errors.ini" 777 | ${If} $ERRORS == 1 778 | !insertmacro MUI_HEADER_TEXT "Error" "An error occurred during the installation of nQuake." 779 | !insertmacro MUI_INSTALLOPTIONS_WRITE "errors.ini" "Field 1" "Text" "There was an error during the installation of nQuake. See below for more information." 780 | ${Else} 781 | !insertmacro MUI_HEADER_TEXT "Errors" "Some errors occurred during the installation of nQuake." 782 | !insertmacro MUI_INSTALLOPTIONS_WRITE "errors.ini" "Field 1" "Text" "There were some errors during the installation of nQuake. See below for more information." 783 | ${EndIf} 784 | !insertmacro MUI_INSTALLOPTIONS_WRITE "errors.ini" "Field 2" "ListItems" $1 785 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "errors.ini" 786 | ${EndIf} 787 | 788 | FunctionEnd 789 | 790 | Function un.UNINSTALL 791 | 792 | !insertmacro MUI_INSTALLOPTIONS_EXTRACT "uninstall.ini" 793 | 794 | # Remove all options on uninstall page except for "remove all files" if install.log is missing 795 | ${Unless} ${FileExists} "$INSTDIR\install.log" 796 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 4" "State" "0" 797 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 4" "Flags" "DISABLED" 798 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 5" "Flags" "DISABLED" 799 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 6" "Text" "Remove all files contained within the nQuake directory (install.log missing)." 800 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 6" "State" "1" 801 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 6" "Flags" "FOCUS" 802 | ${EndUnless} 803 | !insertmacro MUI_HEADER_TEXT "Uninstall nQuake" "Remove nQuake from your computer." 804 | !insertmacro MUI_INSTALLOPTIONS_WRITE "uninstall.ini" "Field 3" "State" "$INSTDIR\" 805 | !insertmacro MUI_INSTALLOPTIONS_DISPLAY "uninstall.ini" 806 | 807 | FunctionEnd 808 | 809 | ;---------------------------------------------------- 810 | ;Welcome/Finish page manipulation 811 | 812 | Function WelcomeShow 813 | # Remove the part about nQuake being an online installer on welcome page if the installer is in offline mode 814 | ${Unless} $OFFLINE == 1 815 | !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "This is the installation wizard of nQuake, a QuakeWorld package made for newcomers, or those who just want to get on with the fragging as soon as possible!\r\n\r\nThis is an online installer and therefore requires a stable internet connection." 816 | ${Else} 817 | !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "This is the installation wizard of nQuake, a QuakeWorld package made for newcomers, or those who just want to get on with the fragging as soon as possible!" 818 | ${EndUnless} 819 | FunctionEnd 820 | 821 | Function FinishShow 822 | # Hide the Back button on the finish page if there were no errors 823 | ${Unless} $ERRORS > 0 824 | GetDlgItem $R0 $HWNDPARENT 3 825 | EnableWindow $R0 0 826 | ${EndUnless} 827 | # Hide the community link if the installer is in offline mode 828 | ${If} $OFFLINE == 1 829 | !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ioSpecial.ini" "Field 5" "HWND" 830 | ShowWindow $R0 ${SW_HIDE} 831 | ${EndIf} 832 | FunctionEnd 833 | 834 | ;---------------------------------------------------- 835 | ;Download size manipulation 836 | 837 | !define SetSize "Call SetSize" 838 | 839 | Function SetSize 840 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_FORTRESS "addons.ini" "Field 3" "State" 841 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_CLANARENA "addons.ini" "Field 4" "State" 842 | !insertmacro MUI_INSTALLOPTIONS_READ $ADDON_TEXTURES "addons.ini" "Field 6" "State" 843 | !insertmacro MUI_INSTALLOPTIONS_READ $DISTFILES_PATH "download.ini" "Field 3" "State" 844 | # Only add shareware if pak0.pak doesn't exist 845 | IntOp $1 0 + 0 846 | ${Unless} ${FileExists} "$INSTDIR\ID1\pak0.pak" 847 | ${If} ${FileExists} "$EXEDIR\pak0.pak" 848 | StrCpy $R0 "$EXEDIR" 849 | ${ElseIf} ${FileExists} "$DISTFILES_PATH\pak0.pak" 850 | StrCpy $R0 "$DISTFILES_PATH" 851 | ${EndIf} 852 | ${GetSize} $R0 "/M=pak0.pak /S=0B /G=0" $7 $8 $9 853 | ${If} $7 == "18689235" 854 | Goto SkipShareware 855 | ${EndIf} 856 | ${EndUnless} 857 | !insertmacro DetermineSectionSize qsw106.zip 858 | IntOp $1 $1 + $SIZE 859 | SkipShareware: 860 | !insertmacro DetermineSectionSize gpl.zip 861 | IntOp $1 $1 + $SIZE 862 | !insertmacro DetermineSectionSize non-gpl.zip 863 | IntOp $1 $1 + $SIZE 864 | !insertmacro DetermineSectionSize textures.zip 865 | IntOp $1 $1 + $SIZE 866 | ${If} $ADDON_FORTRESS == 1 867 | !insertmacro DetermineSectionSize addon-fortress.zip 868 | IntOp $1 $1 + $SIZE 869 | ${EndIf} 870 | ${If} $ADDON_CLANARENA == 1 871 | !insertmacro DetermineSectionSize addon-clanarena.zip 872 | IntOp $1 $1 + $SIZE 873 | ${EndIf} 874 | ${If} $ADDON_TEXTURES == 1 875 | !insertmacro DetermineSectionSize addon-textures.zip 876 | IntOp $1 $1 + $SIZE 877 | ${EndIf} 878 | FunctionEnd 879 | 880 | Function DirectoryPageShow 881 | ${SetSize} 882 | SectionSetSize ${NQUAKE} $1 883 | FunctionEnd 884 | 885 | ;---------------------------------------------------- 886 | ;Functions 887 | 888 | Function .onInit 889 | 890 | !insertmacro MULTIUSER_INIT 891 | GetTempFileName $NQUAKE_INI 892 | 893 | # Download nquake.ini 894 | Start: 895 | inetc::get /NOUNLOAD /CAPTION "Initializing..." /BANNER "nQuake is initializing, please wait..." /TIMEOUT 5000 "${NQUAKE_INI_URL}" $NQUAKE_INI /END 896 | Pop $0 897 | ${Unless} $0 == "OK" 898 | ${If} $0 == "Cancelled" 899 | MessageBox MB_OK|MB_ICONEXCLAMATION "Installation aborted." 900 | Abort 901 | ${Else} 902 | ${Unless} $RETRIES > 0 903 | MessageBox MB_YESNO|MB_ICONEXCLAMATION "Are you trying to install nQuake offline?" IDNO Online 904 | StrCpy $OFFLINE 1 905 | Goto InitEnd 906 | ${EndUnless} 907 | Online: 908 | ${Unless} $RETRIES == 2 909 | MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Could not download nquake.ini." IDCANCEL Cancel 910 | IntOp $RETRIES $RETRIES + 1 911 | Goto Start 912 | ${EndUnless} 913 | MessageBox MB_OK|MB_ICONEXCLAMATION "Could not download nquake.ini. Please try again later." 914 | Cancel: 915 | Abort 916 | ${EndIf} 917 | ${EndUnless} 918 | 919 | # Prompt the user if there are newer installer versions available 920 | ReadINIStr $0 $NQUAKE_INI "versions" "windows" 921 | ${VersionConvert} ${VERSION} "" $R0 922 | ${VersionCompare} $R0 $0 $1 923 | ${If} $1 == 2 924 | MessageBox MB_YESNO|MB_ICONEXCLAMATION "A newer version of nQuake is available.$\r$\n$\r$\nDo you wish to be taken to the download page?" IDNO ContinueInstall 925 | ExecShell "open" ${NQUAKE_URL} 926 | Abort 927 | ${EndIf} 928 | ContinueInstall: 929 | 930 | InitEnd: 931 | 932 | FunctionEnd 933 | 934 | Function un.onInit 935 | 936 | !insertmacro MULTIUSER_UNINIT 937 | 938 | FunctionEnd 939 | 940 | Function .abortInstallation 941 | 942 | # Close open temporary files 943 | FileClose $ERRLOG 944 | FileClose $INSTLOG 945 | FileClose $DISTLOG 946 | 947 | # Write install.log 948 | FileOpen $INSTLOG "$INSTDIR\install.log" w 949 | ${time::GetFileTime} "$INSTDIR\install.log" $0 $1 $2 950 | FileWrite $INSTLOG "Install date: $1$\r$\n" 951 | FileOpen $R0 $INSTLOGTMP r 952 | ClearErrors 953 | ${DoUntil} ${Errors} 954 | FileRead $R0 $0 955 | FileWrite $INSTLOG $0 956 | ${LoopUntil} ${Errors} 957 | FileClose $R0 958 | FileClose $INSTLOG 959 | 960 | # Ask to remove installed files 961 | Messagebox MB_YESNO|MB_ICONEXCLAMATION "Installation aborted.$\r$\n$\r$\nDo you wish to remove the installed files?" IDNO SkipInstRemoval 962 | # Show details window 963 | SetDetailsView show 964 | # Get line count for install.log 965 | Push "$INSTDIR\install.log" 966 | Call .LineCount 967 | Pop $R1 # Line count 968 | IntOp $R1 $R1 - 1 # Remove the timestamp from the line count 969 | FileOpen $R0 "$INSTDIR\install.log" r 970 | # Get installation time from install.log 971 | FileRead $R0 $0 972 | StrCpy $1 $0 -2 14 973 | StrCpy $5 1 # Current line 974 | StrCpy $6 0 # Current % Progress 975 | ${DoUntil} ${Errors} 976 | FileRead $R0 $0 977 | StrCpy $0 $0 -2 978 | ${If} ${FileExists} "$INSTDIR\$0" 979 | ${time::GetFileTime} "$INSTDIR\$0" $2 $3 $4 980 | ${time::MathTime} "second($1) - second($3) =" $2 981 | ${If} $2 >= 0 982 | Delete /REBOOTOK "$INSTDIR\$0" 983 | ${EndIf} 984 | ${EndIf} 985 | # Set progress bar 986 | IntOp $7 $5 * 100 987 | IntOp $7 $7 / $R1 988 | RealProgress::SetProgress /NOUNLOAD $7 989 | IntOp $5 $5 + 1 990 | ${LoopUntil} ${Errors} 991 | FileClose $R0 992 | Delete /REBOOTOK "$INSTDIR\install.log" 993 | ${locate::RMDirEmpty} $INSTDIR /M=*.* $0 994 | DetailPrint "Removed $0 empty directories" 995 | # Remove directory if empty 996 | !insertmacro RemoveFolderIfEmpty $INSTDIR 997 | Goto InstEnd 998 | SkipInstRemoval: 999 | Delete /REBOOTOK "$INSTDIR\install.log" 1000 | InstEnd: 1001 | 1002 | # Ask to remove downloaded distfiles 1003 | Messagebox MB_YESNO|MB_ICONEXCLAMATION "Do you wish to keep the downloaded distribution files?" IDYES DistEnd 1004 | 1005 | ${If} ${FileExists} "$DISTFILES_PATH\addon-clanarena.zip" 1006 | Delete /REBOOTOK "$DISTFILES_PATH\addon-clanarena.zip" 1007 | ${EndIf} 1008 | ${If} ${FileExists} "$DISTFILES_PATH\addon-fortress.zip" 1009 | Delete /REBOOTOK "$DISTFILES_PATH\addon-fortress.zip" 1010 | ${EndIf} 1011 | ${If} ${FileExists} "$DISTFILES_PATH\addon-textures.zip" 1012 | Delete /REBOOTOK "$DISTFILES_PATH\addon-textures.zip" 1013 | ${EndIf} 1014 | ${If} ${FileExists} "$DISTFILES_PATH\gpl.zip" 1015 | Delete /REBOOTOK "$DISTFILES_PATH\gpl.zip" 1016 | ${EndIf} 1017 | ${If} ${FileExists} "$DISTFILES_PATH\non-gpl.zip" 1018 | Delete /REBOOTOK "$DISTFILES_PATH\non-gpl.zip" 1019 | ${EndIf} 1020 | ${If} ${FileExists} "$DISTFILES_PATH\nquake.ini" 1021 | Delete /REBOOTOK "$DISTFILES_PATH\nquake.ini" 1022 | ${EndIf} 1023 | ${If} ${FileExists} "$DISTFILES_PATH\pak0.pak" 1024 | Delete /REBOOTOK "$DISTFILES_PATH\pak0.pak" 1025 | ${EndIf} 1026 | ${If} ${FileExists} "$DISTFILES_PATH\textures.zip" 1027 | Delete /REBOOTOK "$DISTFILES_PATH\textures.zip" 1028 | ${EndIf} 1029 | 1030 | # Remove directory if empty 1031 | !insertmacro RemoveFolderIfEmpty $DISTFILES_PATH 1032 | DistEnd: 1033 | 1034 | # Set progress bar to 100% 1035 | RealProgress::SetProgress /NOUNLOAD 100 1036 | 1037 | Abort 1038 | 1039 | FunctionEnd 1040 | 1041 | Function .checkDistfileDate 1042 | StrCpy $R2 0 1043 | ReadINIStr $0 $NQUAKE_INI "distfile_dates" $R0 1044 | ${If} ${FileExists} "$DISTFILES_PATH\$R0" 1045 | ${GetTime} "$DISTFILES_PATH\$R0" M $2 $3 $4 $5 $6 $7 $8 1046 | # Fix hour format 1047 | ${If} $6 < 10 1048 | StrCpy $6 "0$6" 1049 | ${EndIf} 1050 | StrCpy $1 "$4$3$2$6$7$8" 1051 | ${If} $1 < $0 1052 | ${OrIf} $DISTFILES_REDOWNLOAD == 1 1053 | StrCpy $R2 1 1054 | ${Else} 1055 | ReadINIStr $1 "$DISTFILES_PATH\nquake.ini" "distfile_dates" $R0 1056 | ${Unless} $1 == "" 1057 | ${If} $1 < $0 1058 | StrCpy $R2 1 1059 | ${EndIf} 1060 | ${EndUnless} 1061 | ${EndIf} 1062 | ${EndIf} 1063 | FunctionEnd 1064 | 1065 | Function .installDistfile 1066 | Retry: 1067 | ${Unless} $R2 == 0 # if $R2 is 1 then distfile needs updating, otherwise not 1068 | inetc::get /NOUNLOAD /CAPTION "Downloading..." /BANNER "Downloading $R1 update, please wait..." /TIMEOUT 5000 "$DISTFILES_URL/$R0" "$DISTFILES_PATH\$R0" /END 1069 | ${Else} 1070 | inetc::get /NOUNLOAD /CAPTION "Downloading..." /BANNER "Downloading $R1, please wait..." /TIMEOUT 5000 "$DISTFILES_URL/$R0" "$DISTFILES_PATH\$R0" /END 1071 | ${EndUnless} 1072 | FileWrite $DISTLOG "$R0$\r$\n" 1073 | Pop $0 1074 | ${Unless} $0 == "OK" 1075 | ${If} $0 == "Cancelled" 1076 | Call .abortInstallation 1077 | ${Else} 1078 | MessageBox MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION "Error downloading $R0: $0" IDIGNORE Ignore IDRETRY Retry 1079 | Call .abortInstallation 1080 | Ignore: 1081 | FileWrite $ERRLOG 'Error downloading "$R0": $0|' 1082 | IntOp $ERRORS $ERRORS + 1 1083 | ${EndIf} 1084 | ${EndUnless} 1085 | StrCpy $DISTFILES 1 1086 | DetailPrint "Extracting $R1, please wait..." 1087 | nsisunz::UnzipToStack "$DISTFILES_PATH\$R0" $INSTDIR 1088 | FunctionEnd 1089 | 1090 | Function .installSection 1091 | Pop $R1 # distfile info 1092 | Pop $R0 # distfile filename 1093 | Call .checkDistfileDate 1094 | ${If} ${FileExists} "$EXEDIR\$R0" 1095 | DetailPrint "Extracting $R1, please wait..." 1096 | nsisunz::UnzipToStack "$EXEDIR\$R0" $INSTDIR 1097 | ${ElseIf} ${FileExists} "$DISTFILES_PATH\$R0" 1098 | ${OrIf} $OFFLINE == 1 1099 | ${If} $DISTFILES_UPDATE == 0 1100 | ${OrIf} $R2 == 0 1101 | DetailPrint "Extracting $R1, please wait..." 1102 | nsisunz::UnzipToStack "$DISTFILES_PATH\$R0" $INSTDIR 1103 | ${ElseIf} $R2 == 1 1104 | ${AndIf} $DISTFILES_UPDATE == 1 1105 | Call .installDistfile 1106 | ${EndIf} 1107 | ${ElseUnless} ${FileExists} "$DISTFILES_PATH\$R0" 1108 | Call .installDistfile 1109 | ${EndIf} 1110 | Pop $0 1111 | ${If} $0 == "Error opening ZIP file" 1112 | ${OrIf} $0 == "Error opening output file(s)" 1113 | ${OrIf} $0 == "Error writing output file(s)" 1114 | ${OrIf} $0 == "Error extracting from ZIP file" 1115 | ${OrIf} $0 == "File not found in ZIP file" 1116 | FileWrite $ERRLOG 'Error extracting "$R0": $0|' 1117 | IntOp $ERRORS $ERRORS + 1 1118 | ${Else} 1119 | ${DoUntil} $0 == "" 1120 | ${Unless} $0 == "success" 1121 | FileWrite $INSTLOG "$0$\r$\n" 1122 | ${EndUnless} 1123 | Pop $0 1124 | ${LoopUntil} $0 == "" 1125 | ${EndIf} 1126 | FunctionEnd 1127 | 1128 | Function .LineCount 1129 | Exch $R0 1130 | Push $R1 1131 | Push $R2 1132 | FileOpen $R0 $R0 r 1133 | loop: 1134 | ClearErrors 1135 | FileRead $R0 $R1 1136 | IfErrors +3 1137 | IntOp $R2 $R2 + 1 1138 | Goto loop 1139 | FileClose $R0 1140 | StrCpy $R0 $R2 1141 | Pop $R2 1142 | Pop $R1 1143 | Exch $R0 1144 | FunctionEnd 1145 | 1146 | Function un.LineCount 1147 | Exch $R0 1148 | Push $R1 1149 | Push $R2 1150 | FileOpen $R0 $R0 r 1151 | loop: 1152 | ClearErrors 1153 | FileRead $R0 $R1 1154 | IfErrors +3 1155 | IntOp $R2 $R2 + 1 1156 | Goto loop 1157 | FileClose $R0 1158 | StrCpy $R0 $R2 1159 | Pop $R2 1160 | Pop $R1 1161 | Exch $R0 1162 | FunctionEnd 1163 | -------------------------------------------------------------------------------- /src/nquake-macros.nsh: -------------------------------------------------------------------------------- 1 | # Backups a file to the backup folder 2 | !macro BackupOld FILE 3 | Push 0 4 | ${If} ${FileExists} "$INSTDIR\${FILE}" 5 | ${Unless} ${FileExists} "$INSTDIR\backup" 6 | CreateDirectory "$INSTDIR\backup" 7 | ${EndUnless} 8 | CopyFiles "$INSTDIR\${FILE}" "$INSTDIR\backup" 9 | Delete "$INSTDIR\${FILE}" 10 | Pop $R9 11 | Push 1 12 | ${EndIf} 13 | !macroend 14 | 15 | # Installs a section of nQuake 16 | !macro InstallSection PACKAGE DESCRIPTION 17 | Push ${PACKAGE} 18 | Push "${DESCRIPTION}" 19 | Call .installSection 20 | !macroend 21 | 22 | # Creates a batch file 23 | !macro CreateBatchFile FILE PATH FLAGS 24 | FileOpen $0 "$INSTDIR\${PATH}${FILE}" w 25 | FileWrite $0 "${FLAGS}" 26 | FileWrite $INSTLOG "${PATH}${FILE}$\r$\n" 27 | FileClose $0 28 | !macroend 29 | 30 | # Determines the size of an nQuake section 31 | !macro DetermineSectionSize PACKAGE 32 | ReadINIStr $0 $NQUAKE_INI "distfile_sizes" ${PACKAGE} 33 | StrCpy $SIZE $0 34 | !macroend 35 | 36 | # Remove directory if empty 37 | !macro RemoveFolderIfEmpty FOLDER 38 | ${locate::GetSize} $INSTDIR "/M=*.* /G=1" $0 $1 $2 39 | ${If} $1 == 0 40 | RMDir /REBOOTOK "${FOLDER}" 41 | ${EndIf} 42 | !macroend -------------------------------------------------------------------------------- /src/nquake-welcomefinish.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/src/nquake-welcomefinish.bmp -------------------------------------------------------------------------------- /src/nquake.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nQuake/client-win32/d0e7eb7804221f2f2d7abddc76e2f4d5f9014e95/src/nquake.ico -------------------------------------------------------------------------------- /src/uninstall.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | NumFields=7 3 | 4 | [Field 1] 5 | Type=Label 6 | Left=0 7 | Top=0 8 | Right=300 9 | Bottom=30 10 | Text=nQuake will be uninstalled from the following folder. Select the uninstallation method you wish to use. Click Uninstall to start the uninstallation. 11 | 12 | [Field 2] 13 | Type=Label 14 | Left=0 15 | Top=42 16 | Right=65 17 | Bottom=52 18 | Text=Uninstalling from: 19 | 20 | [Field 3] 21 | Type=Text 22 | Top=40 23 | Left=65 24 | Right=300 25 | Bottom=52 26 | State= 27 | Flags=READONLY 28 | 29 | [Field 4] 30 | Type=RadioButton 31 | Top=75 32 | Left=0 33 | Right=300 34 | Bottom=85 35 | Text=Only remove files installed by nQuake that have not been modified since. 36 | State=1 37 | Flags=FOCUS 38 | 39 | [Field 5] 40 | Type=RadioButton 41 | Top=85 42 | Left=0 43 | Right=300 44 | Bottom=95 45 | Text=Remove all files installed by nQuake. 46 | State=0 47 | 48 | [Field 6] 49 | Type=RadioButton 50 | Top=95 51 | Left=0 52 | Right=300 53 | Bottom=105 54 | Text=Remove all files contained within the nQuake directory. 55 | State=0 56 | 57 | [Field 7] 58 | Type=CheckBox 59 | Top=115 60 | Left=0 61 | Right=300 62 | Bottom=125 63 | Text=Remove locally stored setup files. 64 | State=0 --------------------------------------------------------------------------------