-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.js
67 lines (63 loc) · 2.74 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* Copyright (c) 2024 Serhii I. Myshko
https://github.com/sergeiown/Winget_Upgrade/blob/main/LICENSE */
'use strict';
const os = require('os');
const path = require('path');
const documentsPath = path.join(os.homedir(), 'Documents');
const settings = {
wingetUpgradeVersion: 'Winget Upgrade 1.3',
wingetPath: 'where.exe winget',
wingetVersion: 'winget --version',
logFilePath: path.join(documentsPath, 'winget_upgrade.log'),
listFilePath: path.join(process.cwd(), 'winget_list.json'),
ignoreFilePath: path.join(process.cwd(), 'winget_ignore.json'),
maxLogFileSize: 256 * 1024,
wingetArgs: {
export: [
'export',
'winget_list.json',
'--ignore-warnings',
'--disable-interactivity',
'--accept-source-agreements',
],
import: [
'import',
'winget_list.json',
'--ignore-versions',
'--accept-package-agreements',
'--accept-source-agreements',
'--disable-interactivity',
'--ignore-warnings',
],
},
date: new Date()
.toLocaleString('uk-UA', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
.replace(/,\s*/g, ' ')
.trim(),
finalMessage: `Program will automatically exit after 10 seconds, or press any key to exit immediately.${os.EOL}`,
finalLogMessage: `Upgrade is complete.${os.EOL}`,
notInstalledSollutions: `Possible solutions:${os.EOL}
1. Make sure that winget is installed on your system and that its location is
included in the PATH environment variable. To check, open a command prompt
and type "winget". If the command is not recognized, add the path to the
winget executable in the system's PATH environment variable.${os.EOL}
2. Ensure that your Windows version supports winget (Windows 10 version 1809 or
later, or Windows 11).${os.EOL}
3. Install or reinstall "App Installer". For more details, see the official guide:
https://learn.microsoft.com/en-us/windows/msix/app-installer/install-update-app-installer${os.EOL}
4. Check if there are any group policy restrictions or administrative settings
preventing winget from running.${os.EOL}`,
outdatedVersionInstructions: `Please update winget to continue. Instructions:${os.EOL}
1. Open Microsoft Store and update 'App Installer' to the latest version.${os.EOL}
2. Alternatively, run the following command in the terminal:
winget upgrade --id Microsoft.DesktopAppInstaller -e --source msstore${os.EOL}
3. Ensure your Windows version is Windows 10 version 1809 or later, or Windows 11.${os.EOL}`,
};
module.exports = settings;