@fredlackey/devutils 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
- package/src/commands/install.js +374 -36
- package/src/installs/adobe-creative-cloud.js +527 -25
- package/src/installs/adobe-creative-cloud.md +605 -0
- package/src/installs/appcleaner.js +303 -26
- package/src/installs/appcleaner.md +699 -0
- package/src/installs/apt-transport-https.js +390 -0
- package/src/installs/apt-transport-https.md +678 -0
- package/src/installs/atomicparsley.js +624 -26
- package/src/installs/atomicparsley.md +795 -0
- package/src/installs/aws-cli.js +779 -26
- package/src/installs/aws-cli.md +727 -0
- package/src/installs/balena-etcher.js +688 -26
- package/src/installs/balena-etcher.md +761 -0
- package/src/installs/bambu-studio.js +912 -26
- package/src/installs/bambu-studio.md +780 -0
- package/src/installs/bash-completion.js +554 -23
- package/src/installs/bash-completion.md +833 -0
- package/src/installs/bash.js +399 -26
- package/src/installs/bash.md +993 -0
- package/src/installs/beyond-compare.js +585 -26
- package/src/installs/beyond-compare.md +813 -0
- package/src/installs/build-essential.js +511 -26
- package/src/installs/build-essential.md +977 -0
- package/src/installs/ca-certificates.js +618 -0
- package/src/installs/ca-certificates.md +937 -0
- package/src/installs/caffeine.js +490 -26
- package/src/installs/caffeine.md +839 -0
- package/src/installs/camtasia.js +577 -25
- package/src/installs/camtasia.md +762 -0
- package/src/installs/chatgpt.js +458 -26
- package/src/installs/chatgpt.md +814 -0
- package/src/installs/chocolatey.js +447 -0
- package/src/installs/chocolatey.md +661 -0
- package/src/installs/chrome-canary.js +472 -26
- package/src/installs/chrome-canary.md +641 -0
- package/src/installs/chromium.js +645 -26
- package/src/installs/chromium.md +838 -0
- package/src/installs/claude-code.js +558 -26
- package/src/installs/claude-code.md +1173 -0
- package/src/installs/curl.js +361 -26
- package/src/installs/curl.md +714 -0
- package/src/installs/cursor.js +561 -26
- package/src/installs/cursor.md +970 -0
- package/src/installs/dbschema.js +674 -26
- package/src/installs/dbschema.md +925 -0
- package/src/installs/dependencies.md +435 -0
- package/src/installs/development-tools.js +600 -0
- package/src/installs/development-tools.md +977 -0
- package/src/installs/docker.js +1010 -25
- package/src/installs/docker.md +1109 -0
- package/src/installs/drawio.js +1001 -26
- package/src/installs/drawio.md +795 -0
- package/src/installs/elmedia-player.js +328 -25
- package/src/installs/elmedia-player.md +556 -0
- package/src/installs/ffmpeg.js +870 -25
- package/src/installs/ffmpeg.md +852 -0
- package/src/installs/file.js +464 -0
- package/src/installs/file.md +987 -0
- package/src/installs/gemini-cli.js +793 -26
- package/src/installs/gemini-cli.md +1153 -0
- package/src/installs/git.js +382 -26
- package/src/installs/git.md +907 -0
- package/src/installs/gitego.js +931 -26
- package/src/installs/gitego.md +1172 -0
- package/src/installs/go.js +913 -26
- package/src/installs/go.md +958 -0
- package/src/installs/google-chrome.js +801 -25
- package/src/installs/google-chrome.md +862 -0
- package/src/installs/gpg.js +412 -73
- package/src/installs/gpg.md +1056 -0
- package/src/installs/homebrew.js +1015 -26
- package/src/installs/homebrew.md +988 -0
- package/src/installs/imageoptim.js +950 -26
- package/src/installs/imageoptim.md +1119 -0
- package/src/installs/installers.json +2297 -0
- package/src/installs/jq.js +382 -26
- package/src/installs/jq.md +809 -0
- package/src/installs/keyboard-maestro.js +701 -26
- package/src/installs/keyboard-maestro.md +825 -0
- package/src/installs/latex.js +771 -26
- package/src/installs/latex.md +1095 -0
- package/src/installs/lftp.js +338 -26
- package/src/installs/lftp.md +907 -0
- package/src/installs/lsb-release.js +346 -0
- package/src/installs/lsb-release.md +814 -0
- package/src/installs/messenger.js +829 -26
- package/src/installs/messenger.md +900 -0
- package/src/installs/microsoft-office.js +550 -26
- package/src/installs/microsoft-office.md +760 -0
- package/src/installs/microsoft-teams.js +782 -25
- package/src/installs/microsoft-teams.md +886 -0
- package/src/installs/node.js +886 -26
- package/src/installs/node.md +1153 -0
- package/src/installs/nordpass.js +698 -26
- package/src/installs/nordpass.md +921 -0
- package/src/installs/nvm.js +977 -26
- package/src/installs/nvm.md +1057 -0
- package/src/installs/openssh.js +734 -64
- package/src/installs/openssh.md +1056 -0
- package/src/installs/pandoc.js +644 -26
- package/src/installs/pandoc.md +1036 -0
- package/src/installs/pinentry.js +492 -26
- package/src/installs/pinentry.md +1142 -0
- package/src/installs/pngyu.js +851 -26
- package/src/installs/pngyu.md +896 -0
- package/src/installs/postman.js +781 -26
- package/src/installs/postman.md +940 -0
- package/src/installs/procps.js +425 -0
- package/src/installs/procps.md +851 -0
- package/src/installs/safari-tech-preview.js +355 -25
- package/src/installs/safari-tech-preview.md +533 -0
- package/src/installs/sfnt2woff.js +640 -26
- package/src/installs/sfnt2woff.md +795 -0
- package/src/installs/shellcheck.js +463 -26
- package/src/installs/shellcheck.md +1005 -0
- package/src/installs/slack.js +722 -25
- package/src/installs/slack.md +865 -0
- package/src/installs/snagit.js +566 -25
- package/src/installs/snagit.md +844 -0
- package/src/installs/software-properties-common.js +372 -0
- package/src/installs/software-properties-common.md +805 -0
- package/src/installs/spotify.js +858 -25
- package/src/installs/spotify.md +901 -0
- package/src/installs/studio-3t.js +803 -26
- package/src/installs/studio-3t.md +918 -0
- package/src/installs/sublime-text.js +780 -25
- package/src/installs/sublime-text.md +914 -0
- package/src/installs/superwhisper.js +687 -25
- package/src/installs/superwhisper.md +630 -0
- package/src/installs/tailscale.js +727 -26
- package/src/installs/tailscale.md +1100 -0
- package/src/installs/tar.js +389 -0
- package/src/installs/tar.md +946 -0
- package/src/installs/termius.js +780 -26
- package/src/installs/termius.md +844 -0
- package/src/installs/terraform.js +761 -26
- package/src/installs/terraform.md +899 -0
- package/src/installs/tidal.js +752 -25
- package/src/installs/tidal.md +864 -0
- package/src/installs/tmux.js +328 -26
- package/src/installs/tmux.md +1030 -0
- package/src/installs/tree.js +393 -26
- package/src/installs/tree.md +833 -0
- package/src/installs/unzip.js +460 -0
- package/src/installs/unzip.md +879 -0
- package/src/installs/vim.js +403 -26
- package/src/installs/vim.md +1040 -0
- package/src/installs/vlc.js +803 -26
- package/src/installs/vlc.md +927 -0
- package/src/installs/vscode.js +825 -26
- package/src/installs/vscode.md +1002 -0
- package/src/installs/wget.js +415 -0
- package/src/installs/wget.md +791 -0
- package/src/installs/whatsapp.js +710 -25
- package/src/installs/whatsapp.md +854 -0
- package/src/installs/winpty.js +352 -0
- package/src/installs/winpty.md +620 -0
- package/src/installs/woff2.js +535 -26
- package/src/installs/woff2.md +977 -0
- package/src/installs/wsl.js +572 -0
- package/src/installs/wsl.md +699 -0
- package/src/installs/xcode-clt.js +520 -0
- package/src/installs/xcode-clt.md +351 -0
- package/src/installs/xcode.js +542 -26
- package/src/installs/xcode.md +573 -0
- package/src/installs/yarn.js +806 -26
- package/src/installs/yarn.md +1074 -0
- package/src/installs/yq.js +636 -26
- package/src/installs/yq.md +944 -0
- package/src/installs/yt-dlp.js +683 -26
- package/src/installs/yt-dlp.md +946 -0
- package/src/installs/yum-utils.js +297 -0
- package/src/installs/yum-utils.md +648 -0
- package/src/installs/zoom.js +740 -25
- package/src/installs/zoom.md +884 -0
- package/src/scripts/README.md +567 -45
- package/src/scripts/STATUS.md +208 -0
- package/src/scripts/afk.js +395 -7
- package/src/scripts/backup-all.js +731 -9
- package/src/scripts/backup-source.js +711 -8
- package/src/scripts/brewd.js +373 -7
- package/src/scripts/brewi.js +505 -9
- package/src/scripts/brewr.js +512 -9
- package/src/scripts/brews.js +462 -9
- package/src/scripts/brewu.js +488 -7
- package/src/scripts/c.js +185 -7
- package/src/scripts/ccurl.js +325 -8
- package/src/scripts/certbot-crontab-init.js +488 -8
- package/src/scripts/certbot-init.js +641 -9
- package/src/scripts/ch.js +339 -7
- package/src/scripts/claude-danger.js +253 -8
- package/src/scripts/clean-dev.js +419 -8
- package/src/scripts/clear-dns-cache.js +525 -7
- package/src/scripts/clone.js +417 -7
- package/src/scripts/code-all.js +420 -7
- package/src/scripts/count-files.js +195 -8
- package/src/scripts/count-folders.js +195 -8
- package/src/scripts/count.js +248 -8
- package/src/scripts/d.js +203 -7
- package/src/scripts/datauri.js +373 -8
- package/src/scripts/delete-files.js +363 -7
- package/src/scripts/docker-clean.js +410 -8
- package/src/scripts/dp.js +426 -7
- package/src/scripts/e.js +375 -9
- package/src/scripts/empty-trash.js +497 -7
- package/src/scripts/evm.js +428 -9
- package/src/scripts/fetch-github-repos.js +441 -10
- package/src/scripts/get-channel.js +329 -8
- package/src/scripts/get-course.js +384 -11
- package/src/scripts/get-dependencies.js +290 -9
- package/src/scripts/get-folder.js +783 -10
- package/src/scripts/get-tunes.js +411 -10
- package/src/scripts/get-video.js +352 -9
- package/src/scripts/git-backup.js +561 -9
- package/src/scripts/git-clone.js +477 -9
- package/src/scripts/git-pup.js +303 -7
- package/src/scripts/git-push.js +380 -8
- package/src/scripts/h.js +607 -9
- package/src/scripts/hide-desktop-icons.js +483 -7
- package/src/scripts/hide-hidden-files.js +522 -7
- package/src/scripts/install-dependencies-from.js +440 -9
- package/src/scripts/ips.js +647 -10
- package/src/scripts/iso.js +354 -8
- package/src/scripts/killni.js +561 -7
- package/src/scripts/ll.js +451 -8
- package/src/scripts/local-ip.js +310 -8
- package/src/scripts/m.js +508 -8
- package/src/scripts/map.js +293 -8
- package/src/scripts/mkd.js +287 -7
- package/src/scripts/ncu-update-all.js +441 -8
- package/src/scripts/nginx-init.js +702 -12
- package/src/scripts/npmi.js +366 -7
- package/src/scripts/o.js +495 -8
- package/src/scripts/org-by-date.js +321 -7
- package/src/scripts/p.js +208 -7
- package/src/scripts/packages.js +313 -8
- package/src/scripts/path.js +209 -7
- package/src/scripts/ports.js +582 -8
- package/src/scripts/q.js +290 -8
- package/src/scripts/refresh-files.js +378 -10
- package/src/scripts/remove-smaller-files.js +500 -8
- package/src/scripts/rename-files-with-date.js +517 -9
- package/src/scripts/resize-image.js +523 -9
- package/src/scripts/rm-safe.js +653 -8
- package/src/scripts/s.js +525 -9
- package/src/scripts/set-git-public.js +349 -7
- package/src/scripts/show-desktop-icons.js +459 -7
- package/src/scripts/show-hidden-files.js +456 -7
- package/src/scripts/tpa.js +265 -8
- package/src/scripts/tpo.js +264 -7
- package/src/scripts/u.js +489 -7
- package/src/scripts/vpush.js +422 -8
- package/src/scripts/y.js +267 -7
- package/src/utils/common/os.js +94 -2
- package/src/utils/ubuntu/apt.js +13 -7
- package/src/utils/windows/choco.js +82 -26
- package/src/utils/windows/winget.js +89 -27
package/src/installs/snagit.js
CHANGED
|
@@ -3,42 +3,583 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview Install Snagit.
|
|
5
5
|
* @module installs/snagit
|
|
6
|
+
*
|
|
7
|
+
* Snagit is a professional screen capture and screen recording software developed
|
|
8
|
+
* by TechSmith Corporation. It enables users to capture screenshots of their entire
|
|
9
|
+
* desktop, specific regions, windows, or scrolling content such as web pages and
|
|
10
|
+
* documents. Snagit includes a powerful built-in editor that allows you to add
|
|
11
|
+
* annotations, arrows, text callouts, highlights, and shapes to captured images.
|
|
12
|
+
* The software also supports quick video recording for creating tutorials and
|
|
13
|
+
* demonstrations.
|
|
14
|
+
*
|
|
15
|
+
* IMPORTANT PLATFORM LIMITATION:
|
|
16
|
+
* Snagit is officially supported ONLY on macOS and Windows.
|
|
17
|
+
* TechSmith explicitly states: "Currently, neither Snagit nor Camtasia are
|
|
18
|
+
* supported on Linux. They are only available for Windows and Mac platforms."
|
|
19
|
+
*
|
|
20
|
+
* For unsupported platforms (Ubuntu, Debian, Raspberry Pi OS, Amazon Linux, etc.),
|
|
21
|
+
* this installer will display a simple message and return gracefully without error.
|
|
6
22
|
*/
|
|
7
23
|
|
|
8
24
|
const os = require('../utils/common/os');
|
|
25
|
+
const shell = require('../utils/common/shell');
|
|
26
|
+
const brew = require('../utils/macos/brew');
|
|
27
|
+
const winget = require('../utils/windows/winget');
|
|
28
|
+
const windowsShell = require('../utils/windows/shell');
|
|
29
|
+
const fs = require('fs');
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether this installer requires a desktop environment to function.
|
|
33
|
+
* Snagit is a GUI screen capture and recording application.
|
|
34
|
+
*/
|
|
35
|
+
const REQUIRES_DESKTOP = true;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The Homebrew cask name for Snagit.
|
|
39
|
+
* This is used for both installation checks and the install command.
|
|
40
|
+
*/
|
|
41
|
+
const HOMEBREW_CASK_NAME = 'snagit';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The winget package ID for Snagit.
|
|
45
|
+
* TechSmith publishes Snagit under this identifier in the winget repository.
|
|
46
|
+
* Note: The version year may change (e.g., TechSmith.Snagit.2025, TechSmith.Snagit.2026)
|
|
47
|
+
* but winget typically resolves the latest version when using the base ID.
|
|
48
|
+
*/
|
|
49
|
+
const WINGET_PACKAGE_ID = 'TechSmith.Snagit';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Windows installation paths where Snagit may be installed.
|
|
53
|
+
* We check multiple possible version-specific paths since TechSmith
|
|
54
|
+
* includes the year in the installation folder name.
|
|
55
|
+
*/
|
|
56
|
+
const WINDOWS_INSTALL_PATHS = [
|
|
57
|
+
'C:\\Program Files\\TechSmith\\Snagit 2026',
|
|
58
|
+
'C:\\Program Files\\TechSmith\\Snagit 2025',
|
|
59
|
+
'C:\\Program Files\\TechSmith\\Snagit 2024',
|
|
60
|
+
'C:\\Program Files\\TechSmith\\Snagit 2023'
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Check if Snagit is installed on macOS.
|
|
65
|
+
*
|
|
66
|
+
* Snagit installs to /Applications with a version-specific name like
|
|
67
|
+
* "Snagit 2026.app", so we need to check for any matching pattern
|
|
68
|
+
* rather than an exact app name.
|
|
69
|
+
*
|
|
70
|
+
* @returns {boolean} True if Snagit is installed, false otherwise
|
|
71
|
+
*/
|
|
72
|
+
function isInstalledMacOS() {
|
|
73
|
+
const applicationsDir = '/Applications';
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const entries = fs.readdirSync(applicationsDir);
|
|
77
|
+
// Check if any entry starts with "Snagit" and ends with ".app"
|
|
78
|
+
const snagitApp = entries.find(entry =>
|
|
79
|
+
entry.startsWith('Snagit') && entry.endsWith('.app')
|
|
80
|
+
);
|
|
81
|
+
return !!snagitApp;
|
|
82
|
+
} catch (err) {
|
|
83
|
+
// If we cannot read the directory, assume not installed
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Check if Snagit is installed on Windows.
|
|
90
|
+
*
|
|
91
|
+
* Checks multiple version-specific installation paths because TechSmith
|
|
92
|
+
* includes the year in the folder name (e.g., "Snagit 2025").
|
|
93
|
+
* Falls back to winget list check if path checks fail.
|
|
94
|
+
*
|
|
95
|
+
* @returns {Promise<boolean>} True if Snagit is installed, false otherwise
|
|
96
|
+
*/
|
|
97
|
+
async function isInstalledWindows() {
|
|
98
|
+
// First, check if any known installation path exists
|
|
99
|
+
for (const installPath of WINDOWS_INSTALL_PATHS) {
|
|
100
|
+
const result = await windowsShell.execPowerShell(`Test-Path '${installPath}'`);
|
|
101
|
+
if (result.success && result.stdout.trim().toLowerCase() === 'true') {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Fallback: check via winget in case of a non-standard installation location
|
|
107
|
+
const isPackageInstalled = await winget.isPackageInstalled(WINGET_PACKAGE_ID);
|
|
108
|
+
return isPackageInstalled;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Install Snagit on macOS using Homebrew.
|
|
113
|
+
*
|
|
114
|
+
* Prerequisites:
|
|
115
|
+
* - macOS 15.0 (Sequoia) or later for Snagit 2026
|
|
116
|
+
* - macOS 14.0 (Sonoma) or later for Snagit 2025/2024
|
|
117
|
+
* - Apple Silicon (M1, M2, M3, M4) or Intel processor
|
|
118
|
+
* - Minimum 8 GB RAM recommended
|
|
119
|
+
* - 1.6 GB available disk space
|
|
120
|
+
* - Homebrew package manager installed
|
|
121
|
+
*
|
|
122
|
+
* The installation uses the Homebrew cask 'snagit' which downloads
|
|
123
|
+
* and installs the Snagit application to /Applications/.
|
|
124
|
+
*
|
|
125
|
+
* NOTE: After installation, the user must:
|
|
126
|
+
* 1. Activate their license or start a trial
|
|
127
|
+
* 2. Grant macOS permissions (Screen Recording, Accessibility, etc.)
|
|
128
|
+
* These steps require user interaction and cannot be automated.
|
|
129
|
+
*
|
|
130
|
+
* @returns {Promise<void>}
|
|
131
|
+
* @throws {Error} If Homebrew is not installed or installation fails
|
|
132
|
+
*/
|
|
133
|
+
async function install_macos() {
|
|
134
|
+
console.log('Checking if Snagit is already installed...');
|
|
135
|
+
|
|
136
|
+
// Check if already installed using direct path check
|
|
137
|
+
if (isInstalledMacOS()) {
|
|
138
|
+
console.log('Snagit is already installed, skipping installation.');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Verify Homebrew is available before attempting installation
|
|
143
|
+
if (!brew.isInstalled()) {
|
|
144
|
+
throw new Error(
|
|
145
|
+
'Homebrew is not installed. Please install Homebrew first using:\n' +
|
|
146
|
+
' dev install homebrew\n' +
|
|
147
|
+
'Then retry installing Snagit.'
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
console.log('Installing Snagit via Homebrew...');
|
|
152
|
+
|
|
153
|
+
// Install the cask with quiet mode to reduce output noise
|
|
154
|
+
// Note: This may prompt for administrator password for system components
|
|
155
|
+
const result = await brew.installCask(HOMEBREW_CASK_NAME);
|
|
156
|
+
|
|
157
|
+
if (!result.success) {
|
|
158
|
+
throw new Error(
|
|
159
|
+
`Failed to install Snagit via Homebrew.\n` +
|
|
160
|
+
`Output: ${result.output}\n\n` +
|
|
161
|
+
`Troubleshooting:\n` +
|
|
162
|
+
` 1. Run 'brew update && brew cleanup' and retry\n` +
|
|
163
|
+
` 2. Check macOS version compatibility at techsmith.com/snagit/system-requirements/\n` +
|
|
164
|
+
` 3. Clear Snagit preferences: rm -rf ~/Library/Preferences/com.TechSmith.Snagit*`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Verify the installation succeeded by checking if the app exists
|
|
169
|
+
if (!isInstalledMacOS()) {
|
|
170
|
+
throw new Error(
|
|
171
|
+
'Installation appeared to complete but Snagit was not found in /Applications.\n\n' +
|
|
172
|
+
'Please try reinstalling manually: brew reinstall --cask snagit'
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
console.log('Snagit installed successfully.');
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log('IMPORTANT: Please launch Snagit and complete the following:');
|
|
179
|
+
console.log(' 1. Sign in with your TechSmith account or enter your license key');
|
|
180
|
+
console.log(' 2. Grant macOS permissions when prompted:');
|
|
181
|
+
console.log(' - Screen Recording (System Settings > Privacy & Security)');
|
|
182
|
+
console.log(' - Accessibility (for Snagit and SnagitHelper)');
|
|
183
|
+
console.log(' - Microphone (optional, for video recording)');
|
|
184
|
+
console.log(' - Camera (optional, for webcam capture)');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Install Snagit on Ubuntu/Debian.
|
|
189
|
+
*
|
|
190
|
+
* IMPORTANT: Snagit is NOT officially supported on Ubuntu or Debian.
|
|
191
|
+
* TechSmith explicitly states: "Currently, neither Snagit nor Camtasia are
|
|
192
|
+
* supported on Linux. They are only available for Windows and Mac platforms."
|
|
193
|
+
*
|
|
194
|
+
* This function returns gracefully without error per the project requirements.
|
|
195
|
+
* No alternatives are suggested as per the installation guidelines.
|
|
196
|
+
*
|
|
197
|
+
* @returns {Promise<void>}
|
|
198
|
+
*/
|
|
199
|
+
async function install_ubuntu() {
|
|
200
|
+
console.log('Snagit is not available for Ubuntu/Debian.');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Install Snagit on Raspberry Pi OS.
|
|
205
|
+
*
|
|
206
|
+
* IMPORTANT: Snagit is NOT supported on Raspberry Pi OS due to two
|
|
207
|
+
* fundamental incompatibilities:
|
|
208
|
+
*
|
|
209
|
+
* 1. Architecture: Snagit is compiled for x86/x86_64 processors.
|
|
210
|
+
* Raspberry Pi uses ARM processors, and TechSmith does not release
|
|
211
|
+
* ARM-compiled versions.
|
|
212
|
+
*
|
|
213
|
+
* 2. Operating System: TechSmith only supports macOS and Windows.
|
|
214
|
+
* There is no Linux support of any kind.
|
|
215
|
+
*
|
|
216
|
+
* This function returns gracefully without error per the project requirements.
|
|
217
|
+
* No alternatives are suggested as per the installation guidelines.
|
|
218
|
+
*
|
|
219
|
+
* @returns {Promise<void>}
|
|
220
|
+
*/
|
|
221
|
+
async function install_raspbian() {
|
|
222
|
+
console.log('Snagit is not available for Raspberry Pi OS.');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Install Snagit on Amazon Linux/RHEL.
|
|
227
|
+
*
|
|
228
|
+
* IMPORTANT: Snagit is NOT officially supported on Amazon Linux or RHEL.
|
|
229
|
+
* TechSmith does not provide packages for any Linux distribution.
|
|
230
|
+
*
|
|
231
|
+
* This function returns gracefully without error per the project requirements.
|
|
232
|
+
* No alternatives are suggested as per the installation guidelines.
|
|
233
|
+
*
|
|
234
|
+
* @returns {Promise<void>}
|
|
235
|
+
*/
|
|
236
|
+
async function install_amazon_linux() {
|
|
237
|
+
console.log('Snagit is not available for Amazon Linux/RHEL.');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Install Snagit on Windows using winget.
|
|
242
|
+
*
|
|
243
|
+
* Prerequisites:
|
|
244
|
+
* - Windows 11 (64-bit)
|
|
245
|
+
* - Windows 11 on ARM (23H2 or higher)
|
|
246
|
+
* - Windows 10 (64-bit) version 20H2 or later
|
|
247
|
+
* - Windows Server 2016 or Windows Server 2019
|
|
248
|
+
* - Intel i5 6th Gen / AMD equivalent CPU
|
|
249
|
+
* - Minimum 8 GB RAM recommended
|
|
250
|
+
* - 1.6 GB available disk space
|
|
251
|
+
* - .NET Framework 4.7.2 or later
|
|
252
|
+
* - winget (Windows Package Manager) installed
|
|
253
|
+
*
|
|
254
|
+
* Note: Windows N editions require the Media Foundation Pack.
|
|
255
|
+
* Snagit Printer is not available on Windows on ARM.
|
|
256
|
+
*
|
|
257
|
+
* The installation uses winget with silent flags to minimize user interaction.
|
|
258
|
+
* However, after installation, the user must activate their license or start a trial.
|
|
259
|
+
* This step cannot be automated without enterprise deployment tools.
|
|
260
|
+
*
|
|
261
|
+
* @returns {Promise<void>}
|
|
262
|
+
* @throws {Error} If winget is not installed or installation fails
|
|
263
|
+
*/
|
|
264
|
+
async function install_windows() {
|
|
265
|
+
console.log('Checking if Snagit is already installed...');
|
|
266
|
+
|
|
267
|
+
// Check if already installed
|
|
268
|
+
const alreadyInstalled = await isInstalledWindows();
|
|
269
|
+
if (alreadyInstalled) {
|
|
270
|
+
console.log('Snagit is already installed, skipping installation.');
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Verify winget is available
|
|
275
|
+
if (!winget.isInstalled()) {
|
|
276
|
+
throw new Error(
|
|
277
|
+
'winget (Windows Package Manager) is not available.\n\n' +
|
|
278
|
+
'To install winget:\n' +
|
|
279
|
+
' 1. Install "App Installer" from the Microsoft Store, or\n' +
|
|
280
|
+
' 2. Run: dev install winget\n\n' +
|
|
281
|
+
'Then retry installing Snagit.'
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
console.log('Installing Snagit via winget...');
|
|
286
|
+
|
|
287
|
+
// Install using winget with silent mode and auto-accept agreements
|
|
288
|
+
const result = await winget.install(WINGET_PACKAGE_ID, {
|
|
289
|
+
silent: true
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
if (!result.success) {
|
|
293
|
+
throw new Error(
|
|
294
|
+
`Failed to install Snagit via winget.\n` +
|
|
295
|
+
`Output: ${result.output}\n\n` +
|
|
296
|
+
`Troubleshooting:\n` +
|
|
297
|
+
` 1. Run 'winget source reset --force' and retry\n` +
|
|
298
|
+
` 2. Ensure .NET Framework 4.7.2 is installed\n` +
|
|
299
|
+
` 3. Install WebView2 Runtime: choco install webview2-runtime -y\n` +
|
|
300
|
+
` 4. Ensure you have administrator privileges`
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Verify installation succeeded
|
|
305
|
+
const verified = await isInstalledWindows();
|
|
306
|
+
if (!verified) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
'Installation appeared to complete but Snagit was not found.\n\n' +
|
|
309
|
+
'Please try reinstalling manually:\n' +
|
|
310
|
+
' winget uninstall --id TechSmith.Snagit --silent\n' +
|
|
311
|
+
' winget install --id TechSmith.Snagit --silent --accept-package-agreements --accept-source-agreements'
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
console.log('Snagit installed successfully.');
|
|
316
|
+
console.log('');
|
|
317
|
+
console.log('IMPORTANT: Please launch Snagit and either:');
|
|
318
|
+
console.log(' - Sign in with your TechSmith account');
|
|
319
|
+
console.log(' - Enter your license key via Help > Enter Software Key');
|
|
320
|
+
console.log(' - Start a free trial');
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Install Snagit from Ubuntu running in WSL (Windows Subsystem for Linux).
|
|
325
|
+
*
|
|
326
|
+
* IMPORTANT: Snagit cannot run inside WSL because WSL runs a Linux
|
|
327
|
+
* environment and TechSmith does not support Linux.
|
|
328
|
+
*
|
|
329
|
+
* This function installs Snagit on the Windows HOST instead, which
|
|
330
|
+
* is the recommended approach. WSL applications can still interact with files
|
|
331
|
+
* that Snagit modifies via /mnt/c/.
|
|
332
|
+
*
|
|
333
|
+
* @returns {Promise<void>}
|
|
334
|
+
* @throws {Error} If winget is not available on Windows host or installation fails
|
|
335
|
+
*/
|
|
336
|
+
async function install_ubuntu_wsl() {
|
|
337
|
+
console.log('Detected Ubuntu running in WSL (Windows Subsystem for Linux).');
|
|
338
|
+
console.log('');
|
|
339
|
+
console.log('Snagit cannot run inside WSL because WSL runs a Linux');
|
|
340
|
+
console.log('environment and TechSmith does not support Linux.');
|
|
341
|
+
console.log('');
|
|
342
|
+
console.log('Installing Snagit on the Windows HOST instead...');
|
|
343
|
+
console.log('');
|
|
344
|
+
|
|
345
|
+
// Check if already installed on Windows host via PowerShell interop
|
|
346
|
+
console.log('Checking if Snagit is already installed on Windows host...');
|
|
347
|
+
|
|
348
|
+
// Build a PowerShell command to check multiple version paths
|
|
349
|
+
const checkPaths = WINDOWS_INSTALL_PATHS.map(p => `(Test-Path '${p}')`).join(' -or ');
|
|
350
|
+
const checkResult = await shell.exec(
|
|
351
|
+
`powershell.exe -NoProfile -Command "${checkPaths}"`
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
if (checkResult.code === 0 && checkResult.stdout.trim().toLowerCase() === 'true') {
|
|
355
|
+
console.log('Snagit is already installed on the Windows host, skipping installation.');
|
|
356
|
+
console.log('');
|
|
357
|
+
console.log('You can access Snagit capture files from WSL at:');
|
|
358
|
+
console.log(' /mnt/c/Users/<your-username>/Documents/Snagit/');
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Install via PowerShell interop using winget on the Windows host
|
|
363
|
+
console.log('Installing Snagit on Windows host via winget...');
|
|
364
|
+
|
|
365
|
+
const installResult = await shell.exec(
|
|
366
|
+
`powershell.exe -NoProfile -Command "winget install --id ${WINGET_PACKAGE_ID} --silent --accept-package-agreements --accept-source-agreements"`
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
if (installResult.code !== 0) {
|
|
370
|
+
throw new Error(
|
|
371
|
+
`Failed to install Snagit on the Windows host.\n` +
|
|
372
|
+
`Output: ${installResult.stdout || installResult.stderr}\n\n` +
|
|
373
|
+
`Troubleshooting:\n` +
|
|
374
|
+
` 1. Ensure winget is installed on Windows\n` +
|
|
375
|
+
` 2. Open a Windows PowerShell as Administrator and run:\n` +
|
|
376
|
+
` winget install --id TechSmith.Snagit --silent --accept-package-agreements --accept-source-agreements\n` +
|
|
377
|
+
` 3. Check if you have administrator privileges`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Verify installation succeeded
|
|
382
|
+
const verifyResult = await shell.exec(
|
|
383
|
+
`powershell.exe -NoProfile -Command "${checkPaths}"`
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
if (verifyResult.code !== 0 || verifyResult.stdout.trim().toLowerCase() !== 'true') {
|
|
387
|
+
throw new Error(
|
|
388
|
+
'Installation appeared to complete but Snagit was not found on the Windows host.\n\n' +
|
|
389
|
+
'Please install manually from Windows PowerShell:\n' +
|
|
390
|
+
' winget install --id TechSmith.Snagit --silent --accept-package-agreements --accept-source-agreements'
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
console.log('Snagit installed successfully on the Windows host.');
|
|
395
|
+
console.log('');
|
|
396
|
+
console.log('IMPORTANT: Please launch Snagit from Windows and either:');
|
|
397
|
+
console.log(' - Sign in with your TechSmith account');
|
|
398
|
+
console.log(' - Enter your license key via Help > Enter Software Key');
|
|
399
|
+
console.log(' - Start a free trial');
|
|
400
|
+
console.log('');
|
|
401
|
+
console.log('You can access Snagit capture files from WSL at:');
|
|
402
|
+
console.log(' /mnt/c/Users/<your-username>/Documents/Snagit/');
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Install Snagit from Git Bash on Windows.
|
|
407
|
+
*
|
|
408
|
+
* Git Bash runs within Windows, so this function installs Snagit
|
|
409
|
+
* on the Windows host using winget via PowerShell interop.
|
|
410
|
+
*
|
|
411
|
+
* @returns {Promise<void>}
|
|
412
|
+
* @throws {Error} If winget is not available or installation fails
|
|
413
|
+
*/
|
|
414
|
+
async function install_gitbash() {
|
|
415
|
+
console.log('Detected Git Bash on Windows.');
|
|
416
|
+
console.log('Installing Snagit on the Windows host...');
|
|
417
|
+
console.log('');
|
|
418
|
+
|
|
419
|
+
// Check if already installed on Windows host via PowerShell
|
|
420
|
+
console.log('Checking if Snagit is already installed...');
|
|
421
|
+
|
|
422
|
+
// Build a PowerShell command to check multiple version paths
|
|
423
|
+
const checkPaths = WINDOWS_INSTALL_PATHS.map(p => `(Test-Path '${p}')`).join(' -or ');
|
|
424
|
+
const checkResult = await shell.exec(
|
|
425
|
+
`powershell.exe -NoProfile -Command "${checkPaths}"`
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
if (checkResult.code === 0 && checkResult.stdout.trim().toLowerCase() === 'true') {
|
|
429
|
+
console.log('Snagit is already installed, skipping installation.');
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Install via PowerShell using winget
|
|
434
|
+
console.log('Installing Snagit via winget...');
|
|
435
|
+
|
|
436
|
+
const installResult = await shell.exec(
|
|
437
|
+
`powershell.exe -NoProfile -Command "winget install --id ${WINGET_PACKAGE_ID} --silent --accept-package-agreements --accept-source-agreements"`
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
if (installResult.code !== 0) {
|
|
441
|
+
throw new Error(
|
|
442
|
+
`Failed to install Snagit.\n` +
|
|
443
|
+
`Output: ${installResult.stdout || installResult.stderr}\n\n` +
|
|
444
|
+
`Troubleshooting:\n` +
|
|
445
|
+
` 1. Ensure winget is installed on Windows\n` +
|
|
446
|
+
` 2. Run Git Bash as Administrator and retry\n` +
|
|
447
|
+
` 3. Try using the full PowerShell path:\n` +
|
|
448
|
+
` /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "winget install --id TechSmith.Snagit --silent --accept-package-agreements --accept-source-agreements"`
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Verify installation
|
|
453
|
+
const verifyResult = await shell.exec(
|
|
454
|
+
`powershell.exe -NoProfile -Command "${checkPaths}"`
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
if (verifyResult.code !== 0 || verifyResult.stdout.trim().toLowerCase() !== 'true') {
|
|
458
|
+
throw new Error(
|
|
459
|
+
'Installation appeared to complete but Snagit was not found.\n\n' +
|
|
460
|
+
'Please try installing manually from PowerShell:\n' +
|
|
461
|
+
' winget install --id TechSmith.Snagit --silent --accept-package-agreements --accept-source-agreements'
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
console.log('Snagit installed successfully.');
|
|
466
|
+
console.log('');
|
|
467
|
+
console.log('IMPORTANT: Please launch Snagit and either:');
|
|
468
|
+
console.log(' - Sign in with your TechSmith account');
|
|
469
|
+
console.log(' - Enter your license key via Help > Enter Software Key');
|
|
470
|
+
console.log(' - Start a free trial');
|
|
471
|
+
}
|
|
9
472
|
|
|
10
473
|
/**
|
|
11
|
-
*
|
|
474
|
+
* Check if Snagit is installed on the current platform.
|
|
475
|
+
*
|
|
476
|
+
* This function performs platform-specific checks to determine if Snagit
|
|
477
|
+
* is already installed on the system.
|
|
478
|
+
*
|
|
479
|
+
* @returns {Promise<boolean>} True if Snagit is installed, false otherwise
|
|
480
|
+
*/
|
|
481
|
+
async function isInstalled() {
|
|
482
|
+
const platform = os.detect();
|
|
483
|
+
|
|
484
|
+
if (platform.type === 'macos') {
|
|
485
|
+
return isInstalledMacOS();
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (platform.type === 'windows' || platform.type === 'gitbash' || platform.type === 'wsl') {
|
|
489
|
+
return isInstalledWindows();
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Snagit is not available on Linux platforms
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Check if this installer is supported on the current platform.
|
|
498
|
+
* Snagit is only available on macOS and Windows platforms.
|
|
499
|
+
* @returns {boolean} True if installation is supported on this platform
|
|
500
|
+
*/
|
|
501
|
+
function isEligible() {
|
|
502
|
+
const platform = os.detect();
|
|
503
|
+
// Snagit is only available on macOS and Windows (TechSmith does not support Linux)
|
|
504
|
+
const supportedPlatforms = ['macos', 'wsl', 'windows', 'gitbash'];
|
|
505
|
+
if (!supportedPlatforms.includes(platform.type)) {
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
if (REQUIRES_DESKTOP && !os.isDesktopAvailable()) {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Main installation entry point.
|
|
516
|
+
*
|
|
517
|
+
* Detects the current platform and runs the appropriate installer function.
|
|
518
|
+
* Handles platform-specific mappings to ensure all supported (and unsupported)
|
|
519
|
+
* platforms have appropriate installation logic.
|
|
520
|
+
*
|
|
521
|
+
* Supported platforms:
|
|
522
|
+
* - macOS: Full support via Homebrew cask
|
|
523
|
+
* - Windows: Full support via winget
|
|
524
|
+
* - Git Bash: Full support via PowerShell interop to winget
|
|
525
|
+
* - WSL (Ubuntu): Installs on Windows host via PowerShell interop
|
|
526
|
+
*
|
|
527
|
+
* Unsupported platforms (returns gracefully with message):
|
|
528
|
+
* - Ubuntu/Debian: TechSmith does not provide Linux packages
|
|
529
|
+
* - Raspberry Pi OS: ARM architecture + no Linux support
|
|
530
|
+
* - Amazon Linux/RHEL: No Linux support from TechSmith
|
|
12
531
|
*
|
|
13
532
|
* @returns {Promise<void>}
|
|
14
533
|
*/
|
|
15
534
|
async function install() {
|
|
16
535
|
const platform = os.detect();
|
|
17
536
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
537
|
+
// Map platform types to their installer functions
|
|
538
|
+
// This mapping handles aliases (e.g., debian maps to ubuntu)
|
|
539
|
+
const installers = {
|
|
540
|
+
'macos': install_macos,
|
|
541
|
+
'ubuntu': install_ubuntu,
|
|
542
|
+
'debian': install_ubuntu,
|
|
543
|
+
'ubuntu-wsl': install_ubuntu_wsl,
|
|
544
|
+
'wsl': install_ubuntu_wsl,
|
|
545
|
+
'raspbian': install_raspbian,
|
|
546
|
+
'amazon_linux': install_amazon_linux,
|
|
547
|
+
'amazon-linux': install_amazon_linux,
|
|
548
|
+
'rhel': install_amazon_linux,
|
|
549
|
+
'fedora': install_amazon_linux,
|
|
550
|
+
'windows': install_windows,
|
|
551
|
+
'gitbash': install_gitbash
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
const installer = installers[platform.type];
|
|
555
|
+
|
|
556
|
+
if (!installer) {
|
|
557
|
+
console.log(`Snagit is not available for ${platform.type}.`);
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
await installer();
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// Export all functions for use as a module and for testing
|
|
565
|
+
module.exports = {
|
|
566
|
+
REQUIRES_DESKTOP,
|
|
567
|
+
install,
|
|
568
|
+
isInstalled,
|
|
569
|
+
isEligible,
|
|
570
|
+
install_macos,
|
|
571
|
+
install_ubuntu,
|
|
572
|
+
install_ubuntu_wsl,
|
|
573
|
+
install_raspbian,
|
|
574
|
+
install_amazon_linux,
|
|
575
|
+
install_windows,
|
|
576
|
+
install_gitbash
|
|
577
|
+
};
|
|
41
578
|
|
|
579
|
+
// Allow direct execution: node snagit.js
|
|
42
580
|
if (require.main === module) {
|
|
43
|
-
install()
|
|
581
|
+
install().catch(err => {
|
|
582
|
+
console.error(err.message);
|
|
583
|
+
process.exit(1);
|
|
584
|
+
});
|
|
44
585
|
}
|