0

Is posible to deploy desktop application(wpf o other) using clickonce and let users to decide if they will let the app to to elevate?

3 Answers3

1

Just found and answer by SeanBaker http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/2dfd23ee-ebfa-412c-a5dd-761ec1b55683/. It seems that by design clickonce deployed applications can be elevated only by additional process (asInvoker execution level).

0

ClickOnce won't be the same as installing using windows installer (msi) as the operation is not only limited by user permission rather it's built-in.

There's a comparison between them, see

if you don't need to access to reg keys, or drivers, etc, it won't matter, otherwise it does.

P.S from memory when user install/run clickonce, they are prompted it they will allow it anyway but not administrative privileges as the reasons from above.

john
  • 581
  • 4
  • 9
  • I'm using deploy location 'Install from CD-ROM' and therefore it will be in Full Trust Security Zone. My questions was why not let the applications deployed in full trust to elevate (UAC). – Gheorghe Bulicanu Feb 11 '13 at 08:42
  • Full trust and UAC are different, full trust is on the .NET side whereas UAC is on the Windows side. Check the answer here, it has a good explanation http://stackoverflow.com/questions/102282/does-full-trust-mean-the-same-as-run-as-administrator – john Feb 11 '13 at 22:14
  • I'm aware of differences (I just wanted a solution based on UAC manifest embedded in exe), I've found the answer in one forum I'll post it here later. – Gheorghe Bulicanu Feb 13 '13 at 08:30
  • @GheorgheBulicanu Did you find the solution? I am also looking for a solution where users need to install my clickonce using Administrative privileges. – HSharma Apr 12 '18 at 13:35
0

I also faced with this issue. After many trying I found a very simple solution. I created a shortcut which call the clickonce shortcut by cmd.exe. By this shortcut "run as admin" context menu possibility becomes available or you can adjust the admin privilege by default.

You just need to create a standard short cut and paste this into the Target textbox with inserting your app path:

%SYSTEMROOT%\System32\cmd.exe /C "[path of your "*.appref-ms" file]"

Benefits: You can run your app either as admin or as normal user. You can still enjoy all the benefits of clickonce install.

p.s : The most flexible solution is when you refer to the start menu shortcut of your app.

It would be even nicer if the clickonce installer do also the copy of this shortcut into the start menu next to the application shortcut. I am so interested how it is possible.