|
6 | 6 | "license": "Shareware", |
7 | 7 | "url": "https://www.mirc.com/get.php#/dl.exe", |
8 | 8 | "hash": "c4e001b16aefb94158c6ee0324491b843639548fe5facbb04a03f45b7e3847a9", |
| 9 | + "pre_install": [ |
| 10 | + "if (!(Test-Path \"$dir\\addrbk.ini\")) {", |
| 11 | + " New-Item \"$dir\\addrbk.ini\" -ItemType File | Out-Null", |
| 12 | + "}", |
| 13 | + "if (!(Test-Path \"$dir\\channels.ini\")) {", |
| 14 | + " New-Item \"$dir\\channels.ini\" -ItemType File | Out-Null", |
| 15 | + "}", |
| 16 | + "if (!(Test-Path \"$dir\\mirc.ini\")) {", |
| 17 | + " New-Item \"$dir\\mirc.ini\" -ItemType File | Out-Null", |
| 18 | + "}", |
| 19 | + "if (!(Test-Path \"$dir\\servers.ini\")) {", |
| 20 | + " New-Item \"$dir\\servers.ini\" -ItemType File | Out-Null", |
| 21 | + "}", |
| 22 | + "if (!(Test-Path \"$dir\\urls.ini\")) {", |
| 23 | + " New-Item \"$dir\\urls.ini\" -ItemType File | Out-Null", |
| 24 | + "}" |
| 25 | + ], |
9 | 26 | "post_install": [ |
10 | 27 | "$iniFile=\"$dir\\mirc.ini\"", |
11 | 28 | "if (!(Test-Path \"$iniFile\")) {", |
12 | 29 | " Write-Host \"Creating mIRC ini file at $iniFile\"", |
13 | 30 | " New-Item \"$iniFile\" -ItemType File | Out-Null", |
14 | 31 | "}", |
15 | 32 | "Write-Host \"Setting mIRC to run in portable mode\"", |
16 | | - "(Get-Content \"$iniFile\").Replace('portable=no', 'portable=yes').Replace('check=1', 'check=0') | Set-Content \"$iniFile\"", |
17 | | - "$hasFilesDefinitions = Select-String -Quiet -Pattern \"[files]\" -Path \"iniFile\"", |
18 | | - "if (-not $hasFilesDefinitions) {", |
19 | | - " Add-Content -Path \"$iniFile\" -Value \"[files]`r`nservers=configs/servers.ini`r`nurls=configs/urls.ini`r`naddrbk=configs/addrbk.ini`r`nchannels=configs/channels.ini\"", |
20 | | - "}" |
| 33 | + "(Get-Content \"$iniFile\").Replace('portable=no', 'portable=yes').Replace('check=1', 'check=0') | Set-Content \"$iniFile\"" |
21 | 34 | ], |
22 | 35 | "installer": { |
23 | 36 | "args": [ |
|
42 | 55 | ] |
43 | 56 | ], |
44 | 57 | "persist": [ |
| 58 | + "addrbk.ini", |
| 59 | + "channels.ini", |
45 | 60 | "mirc.ini", |
| 61 | + "urls.ini", |
46 | 62 | "servers.ini", |
47 | | - "channels", |
48 | | - "configs", |
49 | 63 | "download", |
50 | 64 | "logs", |
51 | 65 | "scripts", |
|
0 commit comments