unrealircd- supernets unrealircd source & configuration |
git clone git://git.acid.vegas/unrealircd.git |
Log | Files | Refs | Archive | README | LICENSE |
unrealinst.iss (10593B)
1 ; UnrealIRCd Windows Installation Script 2 ; Requires Inno Setup 4.1.6 or later 3 4 ; Uncomment the line below to package with libcurl support 5 #define USE_CURL 6 7 [Setup] 8 AppName=UnrealIRCd 6 9 AppVerName=UnrealIRCd 6.1.0 10 AppPublisher=UnrealIRCd Team 11 AppPublisherURL=https://www.unrealircd.org 12 AppSupportURL=https://www.unrealircd.org 13 AppUpdatesURL=https://www.unrealircd.org 14 AppMutex=UnrealMutex,Global\UnrealMutex 15 DefaultDirName={pf}\UnrealIRCd 6 16 DefaultGroupName=UnrealIRCd 6 17 AllowNoIcons=yes 18 LicenseFile=src\windows\gplplusssl.rtf 19 Compression=lzma 20 SolidCompression=true 21 MinVersion=6.1 22 OutputDir=. 23 SourceDir=../../ 24 UninstallDisplayIcon={app}\bin\UnrealIRCd.exe 25 UninstallFilesDir={app}\bin\uninstaller 26 DisableWelcomePage=no 27 ArchitecturesInstallIn64BitMode=x64 28 ArchitecturesAllowed=x64 29 ;These are set only on release: 30 ;SignedUninstaller=yes 31 ;SignTool=signtool 32 33 ; !!! Make sure to update TLS validation (WizardForm.TasksList.Checked[9]) if tasks are added/removed !!! 34 [Tasks] 35 Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:" 36 Name: "quicklaunchicon"; Description: "Create a &Quick Launch icon"; GroupDescription: "Additional icons:"; Flags: unchecked 37 Name: "installservice"; Description: "Install as a &service (not for beginners)"; GroupDescription: "Service support:"; Flags: unchecked; MinVersion: 0,4.0 38 Name: "installservice/startboot"; Description: "S&tart UnrealIRCd when Windows starts"; GroupDescription: "Service support:"; MinVersion: 0,4.0; Flags: exclusive unchecked 39 Name: "installservice/startdemand"; Description: "Start UnrealIRCd on &request"; GroupDescription: "Service support:"; MinVersion: 0,4.0; Flags: exclusive unchecked 40 Name: "installservice/crashrestart"; Description: "Restart UnrealIRCd if it &crashes"; GroupDescription: "Service support:"; Flags: unchecked; MinVersion: 0,5.0; 41 Name: "makecert"; Description: "&Create certificate"; GroupDescription: "TLS options:"; 42 Name: "fixperm"; Description: "Make UnrealIRCd folder writable by current user"; 43 44 [Files] 45 ; UnrealIRCd binaries 46 Source: "UnrealIRCd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 47 Source: "UnrealIRCd.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion 48 Source: "unrealircdctl.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 49 Source: "unrealsvc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 50 51 ; TLS certificate generation helpers 52 Source: "src\windows\makecert.bat"; DestDir: "{app}\bin"; Flags: ignoreversion 53 Source: "extras\tls.cnf"; DestDir: "{app}\bin"; Flags: ignoreversion 54 55 ; UnrealIRCd modules 56 Source: "src\modules\*.dll"; DestDir: "{app}\modules"; Flags: ignoreversion signonce 57 Source: "src\modules\chanmodes\*.dll"; DestDir: "{app}\modules\chanmodes"; Flags: ignoreversion signonce 58 Source: "src\modules\usermodes\*.dll"; DestDir: "{app}\modules\usermodes"; Flags: ignoreversion signonce 59 Source: "src\modules\extbans\*.dll"; DestDir: "{app}\modules\extbans"; Flags: ignoreversion signonce 60 Source: "src\modules\rpc\*.dll"; DestDir: "{app}\modules\rpc"; Flags: ignoreversion signonce 61 Source: "src\modules\third\*.dll"; DestDir: "{app}\modules\third"; Flags: ignoreversion skipifsourcedoesntexist signonce 62 63 ; Libraries 64 Source: "c:\dev\unrealircd-6-libs\pcre2\bin\pcre*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 65 Source: "c:\dev\unrealircd-6-libs\argon2\vs2015\build\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 66 Source: "c:\dev\unrealircd-6-libs\libsodium\bin\x64\Release\v142\dynamic\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 67 Source: "c:\dev\unrealircd-6-libs\jansson\bin\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 68 Source: "c:\dev\unrealircd-6-libs\c-ares\msvc\cares\dll-release\cares.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 69 Source: "c:\dev\unrealircd-6-libs\libressl\bin\openssl.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 70 Source: "c:\dev\unrealircd-6-libs\libressl\bin\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 71 Source: "c:\dev\unrealircd-6-libs\GeoIP\libGeoIP\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 72 Source: "c:\dev\unrealircd-6-libs\setacl.exe"; DestDir: "{app}\tmp"; Flags: ignoreversion signonce 73 #ifdef USE_CURL 74 Source: "c:\dev\unrealircd-6-libs\curl\builds\libcurl-vc-x64-release-dll-ssl-dll-cares-dll-ipv6-obj-lib\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion signonce 75 #endif 76 Source: "doc\conf\tls\curl-ca-bundle.crt"; DestDir: "{app}\conf\tls"; Flags: ignoreversion 77 78 ; Config files 79 Source: "doc\conf\*.default.conf"; DestDir: "{app}\conf"; Flags: ignoreversion 80 Source: "doc\conf\*.optional.conf"; DestDir: "{app}\conf"; Flags: ignoreversion 81 Source: "doc\conf\spamfilter.conf"; DestDir: "{app}\conf"; Flags: onlyifdoesntexist 82 Source: "doc\conf\badwords.conf"; DestDir: "{app}\conf"; Flags: onlyifdoesntexist 83 Source: "doc\conf\dccallow.conf"; DestDir: "{app}\conf"; Flags: onlyifdoesntexist 84 Source: "doc\conf\aliases\*.conf"; DestDir: "{app}\conf\aliases"; Flags: ignoreversion 85 Source: "doc\conf\help\*.conf"; DestDir: "{app}\conf\help"; Flags: ignoreversion 86 Source: "doc\conf\examples\*.conf"; DestDir: "{app}\conf\examples"; Flags: ignoreversion 87 Source: "doc\conf\aliases\*"; DestDir: "{app}\conf\aliases"; Flags: ignoreversion 88 89 ; Documentation etc. 90 Source: "doc\Donation"; DestDir: "{app}\doc"; DestName: "Donation.txt"; Flags: ignoreversion 91 Source: "LICENSE"; DestDir: "{app}\doc"; DestName: "LICENSE.txt"; Flags: ignoreversion 92 Source: "doc\*.*"; DestDir: "{app}\doc"; Flags: ignoreversion 93 Source: "doc\technical\*.*"; DestDir: "{app}\doc\technical"; Flags: ignoreversion 94 95 [Dirs] 96 Name: "{app}\tmp" 97 Name: "{app}\bin" 98 Name: "{app}\cache" 99 Name: "{app}\logs" 100 Name: "{app}\conf" 101 Name: "{app}\conf\tls" 102 Name: "{app}\data" 103 Name: "{app}\modules\third" 104 105 [Code] 106 var 107 uninstaller: String; 108 ErrorCode: Integer; 109 110 //********************************************************************************* 111 // This is where all starts. 112 //********************************************************************************* 113 function InitializeSetup(): Boolean; 114 var 115 major: Cardinal; 116 begin 117 Result := true; 118 119 if Not RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Major', major) then 120 begin 121 MsgBox('UnrealIRCd requires the Microsoft Visual C++ Redistributable for Visual Studio 2019 to be installed.' #13 + 122 'After you click OK you will be taken to a download page from Microsoft:' #13 + 123 '1) Scroll down to the section "Visual Studio 2015, 2017 and 2019"' #13 + 124 '2) Click on the x64 "vc_redist.x64.exe" to download the 64 bit installer' #13 + 125 '3) Run the installer.' #13 + #13 + 126 'If you are already absolutely sure that you have this package installed then you can skip this step.', mbInformation, MB_OK); 127 ShellExec('open', 'https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads', '', '', SW_SHOWNORMAL,ewNoWait,ErrorCode); 128 MsgBox('Your browser was launched. After you have installed the Microsoft Visual C++ Redistributable for Visual Studio 2019 (vc_redist.x64.exe), click OK below to continue the UnrealIRCd installer', mbInformation, MB_OK); 129 end; 130 end; 131 132 procedure CurStepChanged(CurStep: TSetupStep); 133 134 var 135 hWnd: Integer; 136 ResultCode: Integer; 137 ResultXP: boolean; 138 Result2003: boolean; 139 Res: Integer; 140 s: String; 141 d: String; 142 begin 143 if CurStep = ssPostInstall then 144 begin 145 d := ExpandConstant('{app}'); 146 if IsTaskSelected('fixperm') then 147 begin 148 // This fixes the permissions in the UnrealIRCd folder by granting full access to the user 149 // running the install. 150 s := '-on "'+d+'" -ot file -actn ace -ace "n:'+GetUserNameString()+';p:full;m:set"'; 151 Exec(d+'\tmp\setacl.exe', s, d, SW_HIDE, ewWaitUntilTerminated, Res); 152 end 153 else 154 begin 155 MsgBox('You have chosen to not have the installer automatically set write access. Please ensure that the user running the IRCd can write to '+d+', otherwise the IRCd will fail to load.',mbConfirmation, MB_OK); 156 end; 157 if IsTaskSelected('installservice') then 158 begin 159 // Similar to above, but this adds full access to NetworkService, 160 // otherwise it cannot copy modules, cannot write to logs, etc etc. 161 s := '-on "'+d+'" -ot file -actn ace -ace "n:NetworkService;p:full;m:set"'; 162 Exec(d+'\tmp\setacl.exe', s, d, SW_HIDE, ewWaitUntilTerminated, Res); 163 end; 164 end; 165 end; 166 167 //********************************************************************************* 168 // Checks if TLS cert file exists 169 //********************************************************************************* 170 171 procedure CurPageChanged(CurPage: Integer); 172 begin 173 if (CurPage = wpSelectTasks) then 174 begin 175 if FileExists(ExpandConstant('{app}\conf\tls\server.cert.pem')) then 176 begin 177 WizardForm.TasksList.Checked[9]:=false; 178 end 179 else 180 begin 181 WizardForm.TasksList.Checked[9]:=true; 182 end; 183 end; 184 end; 185 186 [Icons] 187 Name: "{group}\UnrealIRCd"; Filename: "{app}\bin\UnrealIRCd.exe"; WorkingDir: "{app}\bin" 188 Name: "{group}\Uninstall UnrealIRCd"; Filename: "{uninstallexe}"; WorkingDir: "{app}\bin" 189 Name: "{group}\Make Certificate"; Filename: "{app}\bin\makecert.bat"; WorkingDir: "{app}\bin" 190 Name: "{group}\Documentation"; Filename: "https://www.unrealircd.org/docs/"; WorkingDir: "{app}\bin" 191 Name: "{userdesktop}\UnrealIRCd"; Filename: "{app}\bin\UnrealIRCd.exe"; WorkingDir: "{app}\bin"; Tasks: desktopicon 192 Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\UnrealIRCd"; Filename: "{app}\bin\UnrealIRCd.exe"; WorkingDir: "{app}\bin"; Tasks: quicklaunchicon 193 194 [Run] 195 Filename: "https://www.unrealircd.org/docs/"; Description: "View documentation"; Parameters: ""; Flags: postinstall skipifsilent shellexec runmaximized 196 Filename: "https://www.unrealircd.org/docs/Installing_%28Windows%29"; Description: "View installation instructions"; Parameters: ""; Flags: postinstall skipifsilent shellexec runmaximized 197 Filename: "{app}\bin\unrealsvc.exe"; Parameters: "install"; Flags: runminimized nowait; Tasks: installservice 198 Filename: "{app}\bin\unrealsvc.exe"; Parameters: "config startup manual"; Flags: runminimized nowait; Tasks: installservice/startdemand 199 Filename: "{app}\bin\unrealsvc.exe"; Parameters: "config startup auto"; Flags: runminimized nowait; Tasks: installservice/startboot 200 Filename: "{app}\bin\unrealsvc.exe"; Parameters: "config crashrestart 2"; Flags: runminimized nowait; Tasks: installservice/crashrestart 201 Filename: "{app}\bin\makecert.bat"; Tasks: makecert; Flags: postinstall; 202 203 [UninstallRun] 204 Filename: "{app}\bin\unrealsvc.exe"; Parameters: "uninstall"; Flags: runminimized; RunOnceID: "DelService"; Tasks: installservice