3

i was making an installer for my app its working fine on xp but on vista the UAC is giving problem unless i do a run as administrator the Unexpected error appears when i run my app afters installation, any idea? i am installing the application in C:\xfolder\x

Liviu Mandras
  • 6,540
  • 2
  • 41
  • 65
PUG
  • 4,301
  • 13
  • 73
  • 115

2 Answers2

3

There is nothing you can do. You MUST run the installer as administrator.

As for the application, you will also need to run it as administrator with elevated priviledges but thre are options to make it ask automatically for elevation via application manifest. You can do a search on stackoverflow.com because there are more post related to this issue.

Here is a link to a post that might help.

Here are a couple more usefull link on app manifest and UAC:

UAC technology.

They are in C# but then again translating to VB.net is like a walk in the park.

You can make a windows service. And put all operations that require elevated rights into that service. You install the service as SYSTEM account and you communicate with the client via .net remoting or any other way for vb6.

Community
  • 1
  • 1
Liviu Mandras
  • 6,540
  • 2
  • 41
  • 65
  • if it prompts the user before installing thats ok with me. how do run the exe after program is installed without asking user anything is my question? – PUG Nov 10 '10 at 12:54
  • There was a question on stackoverflow about that I think. Probably you can do that with the app manifest also. – Liviu Mandras Nov 10 '10 at 14:04
  • @jaminator Sure. It does not depend on language. The manifest is an xml file actually that has specific elements. – Liviu Mandras Nov 11 '10 at 10:57
  • The link I posted is for C# but for VB should be easy to translate. – Liviu Mandras Nov 11 '10 at 10:58
  • Liviu i have embeded the manifest in my exe, thanks for your help but the problem is that if one of my app user is using the app on a machine in which he does not have adminitrator rights then how come the user will be elevated to administrator to run the app. CRUCIAL POINT – PUG Nov 12 '10 at 10:34
  • i made an application in legacy vb6 and wanted to run it on win 7 but the UAC wont allow me to run the app after installation until i do a Run as administrator, so i made a manifest file and embedded it in exe using resource hacker now win 7 does run the app but every time i run the app it ask to allow or dont allow what shoul i do – PUG Nov 12 '10 at 11:05
  • I put a post to a similar question and I was getting only down votes because it was a "big security" risk. But I will give you the idea anyway. Please see edit. – Liviu Mandras Nov 12 '10 at 12:31
  • Liviu apologies for my ignorance but i didnt get your last comment! – PUG Nov 12 '10 at 12:33
  • See the last paragraph in the answer. The solution I mentioned there was categorized as "security" risk. I gave it as an aswer to another similar question to yours. – Liviu Mandras Nov 12 '10 at 12:50
2

if your app exe is an active x exe then you will need to register all the ocx file using regsvr command and then register your exe with regsvr32 command, for an active class to be used in win vista it first must be registered. make a batch to do these registration.

PUG
  • 4,301
  • 13
  • 73
  • 115