AudioSwitcher_v1
AudioSwitcher_v1 copied to clipboard
Fix: Update AudioSwitcher
In the case that the audio switcher application is running in the Program Files or Program Files (x86) folders, then when running the Update application it needs to be run in an elevated state, otherwise an unhandled exception is thrown from the updater application.
File: AudioSwitcher_v1/FortyOne.AudioSwitcher/UpdateForm.cs Line: 56
Update from:
Process.Start(updaterPath, );
To:
ProcessStartInfo startInfo = new ProcessStartInfo(updaterPath, Process.GetCurrentProcess().Id + " \"" + Assembly.GetEntryAssembly().Location + "\"");
startInfo.UseShellExecute = true;
startInfo.Verb = ProcessExtensions.RunElevatedVerb;
Process.Start(startInfo);
Confirmed that this is an issue.
The given solution seems to be a good compromise.
Audio Switcher should run without admin privileges wherever possible, but the updater may require them.
Will investigate changing this, and the user impact (if any).
Another solution, (maybe better) would be to have the updater check if an elevated state is required and if so then restart in elevated state.
Same implementation almost as above, but impact is then only on the updater and not the audio switcher itself.
The following UAC Helper has an over complex implementation but it can be dumbed down easily enough.