PDA

Click to See Complete Forum and Search --> : Running VB6 app setup program on Vista


Tomexx
Jan 12th, 2009, 11:45 AM
Hi,
I'm just learning the in & outs of Vista UAC. My vb6 app is packaged using Inno setup into a setup.exe.


I've been searching these forums for all the DOs & DONTs of installing a VB6 app on Vista with UAC.

One of the issus is running setup program.
I keep reading about the need to tell my users to Right-Click setup.exe and select "Run as administrator" in order to install the program correctly.

So I did a little test:

* First: Install for standard user account (no admin privilages)
I found that Double-Clicking the setup.exe and Right-Clicking -> "Run as administrator" yelded the same results: UAC asking for admin password. After entering the password the setup program installs.

* Second: Install for administrator account
I found that Double-Clicking the setup.exe and Right-Clicking -> "Run as administrator" yelded the same results: UAC asking Allow or Deny. After entering the password the setup program installs.


So a "normal" double-clicking setup.exe seems to produce the same dialogs as Right-Clicking -> Selecting "Run as administrator"

If that's the case, why would I tell my users to right-click and run the setup as administrator? Why can't they just double-click as they always did?

RobDog888
Jan 12th, 2009, 12:39 PM
Thread Moved

Right clicking and selecting Run as Administrator will not ever bypass the UAC prompt (unless its off) and the user will need to have admin login credientials.

Are you using a manifest file specifying the elevation request to admin?

Tomexx
Jan 12th, 2009, 12:57 PM
Hi Rob,
All I'm asking is what's the advantage of right-clicking, "Run as administrator" if regular double-clicking setup.exe gives the same UAC prompt.

Rob, all I want is to deploy vb6 app on vista with minimum hassle to the end user. The end user might have full admin privilages or he might not have any. I'm not accessing any files from Program Files, just installing the exe there. There're no data files.

What's the right approach?
Is there a special directive in INNO setup that I should be using on Vista?
Is double clicking my setup.exe the right way to start installation on Vista?
Do I really have to tell users to right-click the file and "Run as admin"?
What is the manifest file and why I would need it?

RobDog888
Jan 12th, 2009, 01:16 PM
If you are an Admin and right click blah then it wont display the popup. If you dont have admin rights then it will prompt either way you run it.

The manifest file is like the ones used for displaying XP themes on a vb6 form with the addition on an extra node to specify the elevation request level. To install any program on Vista a user need permissions and depending upon how their system is set, it may or may not be allowed by non-admins.

RobDog888
Jan 12th, 2009, 01:26 PM
these should be of some help
Permissions:
http://msdn.microsoft.com/en-us/library/aa480150.aspx

Manifest file:
http://www.vbforums.com/showpost.php?p=3384393&postcount=6

Tomexx
Jan 12th, 2009, 01:45 PM
Ok, then not all non-admins can install programs.
So I should tell my users to right-click "run as admin" if they're having trouble installing, right?

How about the manifest file, how do I incorporate it, how does it solve the problem?

Magic Ink
Jan 12th, 2009, 04:49 PM
If a program filename includes the word 'setup' Vista (with UAC on) automatically prompts for elevation; and the program's icon in Explorer will include the little shield.

dilettante
Jan 13th, 2009, 09:59 AM
There are a number of things Vista will sniff for trying to determine whether a program is a legacy installer (and require elevation). One thing is key substrings in the name (setup, update, etc.). Another place it looks is in extended property strings (Description, etc.) Yet another is Vista's small dictionary of byte strings in certain locations in the EXE used to identify "well known" legacy installer products.

Inno is not "well known" and apparently doesn't use the extended properties correctly, so if you don't name the resulting EXE right... users have problems. I think they've developed a hack now of inserting a "require admin" manifest though that is far from correct. This will require elevation but causes Windows to have no idea an installer is being run.

It is quite possible to create an innocent EXE that falls prey to any of these things if it doesn't have a manifest. You might copy some simple EXE to Vista and if it hits any of the detection criteria its icon will get the elevation sheild and it will require elevation because Vista assumes it is an installer. A proper Vista manifest bypasses this "setup sniffing."

Manifests contain a lot of things besides an "XP styles" and execution level request, though many people use vestigial ones with only those attributes present.


The only "first-class citizen" packages are Windows Installer MSIs, MSUs, etc. and the Inno product doesn't create them. With care these can be used for per-user installation without ever requiring elevation, but this also has its downsides. However it is so useful that Windows 7 includes new support to make per-user installs a little easier to do. Vista SP2 should be backporting this technology but the essentials to do it properly have been in place since XP came out.

ClickOnce is another fully supported installer technology but has its own troubles and is very difficult to use with VB6 right now. I'm sure we'll have that nut cracked soon though.

dilettante
Jan 13th, 2009, 10:02 AM
Inno, PDW, IExpress, etc. are still perfectly fine to use. There are just a few "gotchas" to be aware of.