Skip to content

Commit 0f7581b

Browse files
github-actions[bot]chasprowebdevMarfuen
authored
fix(device-agent): implement the installer-cleanup fix (#3381)
Co-authored-by: chasprowebdev <chasgarciaprowebdev@gmail.com> Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
1 parent f41f006 commit 0f7581b

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# Remove per-user app data on uninstall (not on upgrade), so a stale device-linking
3+
# auth token doesn't survive a reinstall and silently skip the sign-in screen.
4+
ACTION="$1"
5+
6+
case "$ACTION" in
7+
remove|purge)
8+
for home in /root /home/*; do
9+
[ -d "$home" ] || continue
10+
config_dir="$home/.config/comp-ai-device-agent"
11+
if [ -d "$config_dir" ]; then
12+
rm -rf "$config_dir"
13+
fi
14+
done
15+
;;
16+
esac
17+
18+
exit 0

‎packages/device-agent/electron-builder.config.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module.exports = {
6060
perMachine: true,
6161
allowToChangeInstallationDirectory: false,
6262
artifactName: 'CompAI-Device-Agent-${version}-setup.${ext}',
63+
deleteAppDataOnUninstall: true,
6364
},
6465
linux: {
6566
target: [
@@ -78,6 +79,7 @@ module.exports = {
7879
},
7980
deb: {
8081
afterInstall: 'assets/linux/after-install.sh',
82+
afterRemove: 'assets/linux/after-remove.sh',
8183
packageName: 'comp-ai-device-agent',
8284
compression: 'xz',
8385
},

0 commit comments

Comments
 (0)