{"id":172,"date":"2007-03-28T12:00:43","date_gmt":"2007-03-28T11:00:43","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/?p=172"},"modified":"2007-03-28T12:00:43","modified_gmt":"2007-03-28T11:00:43","slug":"dont-call-your-windows-app-updateanything","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/172-dont-call-your-windows-app-updateanything.html","title":{"rendered":"Don&#8217;t call your Windows app UpdateAnything"},"content":{"rendered":"<p>I wrote a little Windows utility that updates a file. It&#8217;s safe and harmless; it just modifies a file which is in my user documents folder. I called the utility UpdateMSI. Under Vista with UAC enabled, running this app throws up a dialog:<\/p>\n<blockquote>\n<p>An unidentified program wants access to your computer<\/p>\n<\/blockquote>\n<p>But why? Simple: Vista inspects the <strong>name of the executable<\/strong>, notes that it includes the word &#8220;update&#8221;, and concludes that it needs local administrator rights.<\/p>\n<p>On the face of it, this is silly. First of all, Vista is wrong: my app does not need admin rights. Second, it is infuriating that I am not given any choice in the matter. The UAC dialog says &#8220;Cancel&#8221; or &#8220;Allow&#8221;. It does not include the option to run with my normal user rights.<\/p>\n<p>Microsoft did this in an effort to detect setup applications; the word &#8220;setup&#8221; has the same effect. It will trigger if the word is anywhere in the executable name. I tried it with WorldCupDatePicker.exe &#8211; same result.<\/p>\n<p>Surely it would not have been too hard to give the user a say in this? Just a checkbox that says &#8220;Let me run this how I want on my computer&#8221;? You can disable UAC of course; but I&#8217;m not going to do that; overall it&#8217;s a good feature.<\/p>\n<p>If you wrote the app, there is a fix. You have to embed a UAC manifest in your application. There are <a href=\"http:\/\/www.frameworkx.com\/frameworkx\/contentblogdetail.aspx?blog=56&amp;id=530\" target=\"_blank\">simple instructions here<\/a>, though note that these explain how to force the&nbsp;UAC prompt, not how to suppress it. If you don&#8217;t want to run as admin, modify the line:<\/p>\n<p>&lt;requestedExecutionLevel level=&#8221;requireAdministrator&#8221;\/&gt;&nbsp;<\/p>\n<p>to read instead: <\/p>\n<p>&lt;requestedExecutionLevel level=&#8221;asInvoker&#8221;\/&gt;  <\/p>\n<p>Bottom line: always include a manifest.<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:aa9314ed-33e3-4e5b-9391-bfc91053247d\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/uac\" rel=\"tag\">uac<\/a>, <a href=\"http:\/\/technorati.com\/tags\/security\" rel=\"tag\">security<\/a>, <a href=\"http:\/\/technorati.com\/tags\/vista\" rel=\"tag\">vista<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I wrote a little Windows utility that updates a file. It&#8217;s safe and harmless; it just modifies a file which is in my user documents folder. I called the utility UpdateMSI. Under Vista with UAC enabled, running this app throws up a dialog: An unidentified program wants access to your computer But why? Simple: Vista &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/172-dont-call-your-windows-app-updateanything.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Don&#8217;t call your Windows app UpdateAnything<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[80,97],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-software-development","category-windows"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=172"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/172\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}