2023-08-12 01:40:29 +01:00
|
|
|
function Get_VMPath {
|
2023-08-17 15:02:03 +01:00
|
|
|
$REG_KEY = @(
|
|
|
|
"Registry::HKEY_LOCAL_MACHINE",
|
|
|
|
"Software",
|
|
|
|
(& { if ([Environment]::Is64BitOperatingSystem) { "WOW6432Node" } else { "" } }),
|
|
|
|
"Microsoft",
|
|
|
|
"Windows",
|
|
|
|
"CurrentVersion",
|
|
|
|
"Uninstall"
|
|
|
|
).Where({ $_ -ne "" }) -Join "\"
|
|
|
|
$VM_KEY = "VB:Voicemeeter {17359A74-1236-5467}"
|
2022-01-08 16:07:02 +00:00
|
|
|
|
2023-08-16 02:52:12 +01:00
|
|
|
try {
|
2023-08-17 15:02:03 +01:00
|
|
|
return $(Get-ItemPropertyValue -Path (@($REG_KEY, $VM_KEY) -Join "\") -Name UninstallString | Split-Path -Parent)
|
2023-08-16 02:52:12 +01:00
|
|
|
}
|
|
|
|
catch {
|
2023-08-16 16:36:43 +01:00
|
|
|
throw [VMRemoteError]::new("Unable to fetch Voicemeeter path from the Registry.")
|
2023-08-16 02:52:12 +01:00
|
|
|
}
|
2021-05-04 17:29:38 +01:00
|
|
|
}
|