AudioSwitcher_v1 icon indicating copy to clipboard operation
AudioSwitcher_v1 copied to clipboard

Fix: Update AudioSwitcher

Open priestofpsi opened this issue 9 years ago • 2 comments
trafficstars

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);

priestofpsi avatar Mar 08 '16 17:03 priestofpsi

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).

xenolightning avatar Mar 08 '16 19:03 xenolightning

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.

priestofpsi avatar Mar 09 '16 07:03 priestofpsi