-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUpdate-DymoConnect.ps1
More file actions
87 lines (60 loc) · 2.3 KB
/
Update-DymoConnect.ps1
File metadata and controls
87 lines (60 loc) · 2.3 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Written to update Dymo Connect because it's a manual software update according to them
# Jonathan Bullock
# 2025 - 06 - 19
# PS Sorry but this software is shit
# set the download url
# Tried to get it to parse the site but cloudflare blocks scraping and im too smooth brained to figure that out for this shit software.
$installerUrl = "https://download.dymo.com/dymo/Software/Win/DCDSetup1.4.9.12.exe"
$installerPath = "$env:TEMP\DymoConnectInstaller.exe"
# get version number from the filename
if ($installerUrl -match "DCDSetup([\d\.]+)\.exe") {
$latestVersion = $matches[1]
Write-Output "Parsed version from URL: $latestVersion"
} else {
Write-Error "Failed to parse version from installer URL"
exit 1
}
function Get-InstalledDymoVersion {
$registryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
foreach ($path in $registryPaths) {
$app = Get-ItemProperty -Path $path -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*DYMO Connect*" }
if ($app) {
return $app.DisplayVersion
}
}
return $null
}
function Install-Dymo {
param (
[string]$Url,
[string]$Path
)
Write-Output "Downloading DYMO installer..."
Invoke-WebRequest -Uri $Url -OutFile $Path -UseBasicParsing
Write-Output "Installing DYMO Connect silently..."
Start-Process -FilePath $Path -ArgumentList "/S /v`"/qn`"" -Wait
Write-Output "Cleaning up installer..."
Remove-Item -Path $Path -Force -ErrorAction SilentlyContinue
}
# install or not
$installedVersion = Get-InstalledDymoVersion
Write-Output "Installed version: $installedVersion"
Write-Output "Latest available version: $latestVersion"
function Get-InstalledDymoVersion {
$registryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
foreach ($path in $registryPaths) {
$apps = Get-ItemProperty -Path $path -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*DYMO Connect*" }
if ($apps) {
return $apps[0].DisplayVersion
}
}
return $null
}