Skip to content

Commit f1dbf8b

Browse files
committed
Persist mIRC
1 parent bbaeb0d commit f1dbf8b

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

bucket/mirc.json

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,31 @@
66
"license": "Shareware",
77
"url": "https://www.mirc.com/get.php#/dl.exe",
88
"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+
],
926
"post_install": [
1027
"$iniFile=\"$dir\\mirc.ini\"",
1128
"if (!(Test-Path \"$iniFile\")) {",
1229
" Write-Host \"Creating mIRC ini file at $iniFile\"",
1330
" New-Item \"$iniFile\" -ItemType File | Out-Null",
1431
"}",
1532
"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\""
2134
],
2235
"installer": {
2336
"args": [
@@ -42,10 +55,11 @@
4255
]
4356
],
4457
"persist": [
58+
"addrbk.ini",
59+
"channels.ini",
4560
"mirc.ini",
61+
"urls.ini",
4662
"servers.ini",
47-
"channels",
48-
"configs",
4963
"download",
5064
"logs",
5165
"scripts",

0 commit comments

Comments
 (0)