Skip to content

Commit 43b36fe

Browse files
authored
installer: better batch script
1 parent 76b6989 commit 43b36fe

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

themes/hugo-html5up-alpha/layouts/partials/installer.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,10 @@ <h2>Restart</h2>
158158
};
159159

160160
const paths = {
161-
'stable': '%localappdata%\\Discord\\app-1.0.9059\\resources',
162-
'stable_x64': '%localappdata%\\Discord\\app-1.0.9177\\resources',
163-
'stable_x64_2': '%localappdata%\\Discord\\app-1.0.9098\\resources',
161+
'stable': '%localappdata%\\Discord\\app-1.0.9178\\resources',
162+
'stable_old': '%localappdata%\\Discord\\app-1.0.9059\\resources',
164163
'ptb': '%localappdata%\\DiscordPTB\\app-1.0.1091\\resources',
165-
'canary': '%localappdata%\\DiscordCanary\\app-1.0.329\\resources',
164+
'canary': '%localappdata%\\DiscordCanary\\app-1.0.534\\resources',
166165
'canary_x64': '%localappdata%\\DiscordCanary\\app-1.0.523\\resources'
167166
};
168167

@@ -176,6 +175,10 @@ <h2>Restart</h2>
176175
// discord's updater is really good so sometimes even fresh installs are 2 versions out of date.
177176
const olderPath = degradePath(oldPath);
178177
const oldestPath = degradePath(olderPath);
178+
179+
const newPath = degradePath(path, -1);
180+
const newerPath = degradePath(newPath, -1);
181+
const newestPath = degradePath(newerPath, -1);
179182

180183
batch = `@echo off
181184
echo Closing Discord... (wait around 5 seconds)
@@ -198,18 +201,18 @@ <h2>Restart</h2>
198201
199202
${channel === 'canary' ? `if exist "${paths.canary_x64}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${paths.canary_x64.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
200203
201-
${channel === 'stable' ? `if exist "${paths.stable_x64}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${paths.stable_x64.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
202-
${channel === 'stable' ? `if exist "${degradePath(paths.stable_x64)}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(paths.stable_x64).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
203-
${channel === 'stable' ? `if exist "${degradePath(degradePath(paths.stable_x64))}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(degradePath(paths.stable_x64)).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
204-
205-
${channel === 'stable' ? `if exist "${paths.stable_x64_2}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${paths.stable_x64_2.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
206-
${channel === 'stable' ? `if exist "${degradePath(paths.stable_x64_2)}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(paths.stable_x64_2).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
207-
${channel === 'stable' ? `if exist "${degradePath(degradePath(paths.stable_x64_2))}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(degradePath(paths.stable_x64_2)).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
204+
${channel === 'stable' ? `if exist "${paths.stable_old}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${paths.stable_old.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
205+
${channel === 'stable' ? `if exist "${degradePath(paths.stable_old)}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(paths.stable_old).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
206+
${channel === 'stable' ? `if exist "${degradePath(degradePath(paths.stable_old))}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${degradePath(degradePath(paths.stable_old)).replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul` : ''}
208207
209208
if exist "${oldPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${oldPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
210209
if exist "${olderPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${olderPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
211210
if exist "${oldestPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${oldestPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
212211
212+
if exist "${newPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${newPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
213+
if exist "${newerPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${newerPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
214+
if exist "${newestPath}\\app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${newestPath.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar\\"" > nul 2> nul
215+
213216
if exist "${path}\\_app.asar" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${path.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\_app.asar\\"" > nul 2> nul
214217
if exist "${path}\\app.asar.orig" powershell -Command "Invoke-WebRequest https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar -OutFile \\"${path.replace('%localappdata%', '$Env:LOCALAPPDATA')}\\app.asar.orig\\"" > nul 2> nul
215218

0 commit comments

Comments
 (0)