I have a VB6 application that needs to be installed on Windows Vista as a Standard User. Using Visual Studio 2005 I have created a setup project that will place the application in a standard user safe place or folder. I also have a dll that I want to install and register to the users application data folder. Once my windows installer is created in VS'05 I flipped the word count properties' 3rd bit using msiinfo.exe so that Vista will not prompt Admin credentials when it runs the msi. The application installs without any problems until it tries to register the dll to the users application data folder. When it reaches that point it throws an error stating that it cannot register the type library for the dll. It appears the installer does not have the authority to register a dll to the users folder. Is this correct? My understanding was that Vista only complained about standard users updating or changing items that affected all users of a machine. Any ideas? Thoughts? Suggestions?
Registering a DLL does impact all users (DLLs are registered globally) and therefore requires Admin permissions. There is no way around that.
The solution for newer programming environments is that the DLL doesn't need to be registered to be used. However, since vb6 relies on COM you're probably out of luck.
Generally I agree to what Joel Coehoorn says in his answer.
However, knowing how the registry works in this regard, I can make the suggestion that you try to manually register your DLL to HKEY_CURRENT_USER\SOFTWARE\Classes
, basically repeating what regsvr32.exe would do to HKEY_LOCAL_MACHINE\SOFTWARE\Classes
.
It's a bit of a hack, and maybe it won't work, but you can try it.
- related post on MSDN: http://msdn.microsoft.com/en-us/library/ms693350.aspx (thanks to MarkJ pointing this out in the comments)
- related post on vbforums.com: http://www.vbforums.com/showthread.php?t=507228
Instead of registering your DLL files directly, you can use RegFree COM.
This involves creating an XML manifest file for your app, so Windows will look for your DLL files in the application folder, instead of using the system registry to find them.
This means your app will run properly without your installer having to register DLLs.
These links have more info:
http://msdn.microsoft.com/en-us/magazine/cc188708.aspx
http://www.devx.com/vb/Article/32888/1954
You can use the free Make My Manifest software to create the manifest files you need:
Steve
My suggestion is, if you are able, to use regfree com / manifest files instead of registering the ocx/dll files, which as you mention is a real chore under a basic user account.
There is an excellent free app you can use to build the manifest for you as well here: http://mmm4vb6.atom5.com/
We have been using this for a few years now, with no issues.
- Registry-free COM: MakeMyManifest is well spoken of. It is an automatic tool for creating manifests for VB6 projects: I haven't tried it myself.
- DirectCOM is an alternative to registry-free COM. It also has fans, again I haven't tried it.
There is a semi-automatic technique for creating manifests for registry-free COM. You can create the manifests with Visual Studio 2008 (you can use a free version like Visual Basic Express Edition). Then make a couple of edits by hand to make the manifests suitable for use from VB6. See this section of this MSDN article for step-by-step instructions - ignore the rest of the article which is about ClickOnce.
THIS IS NOT ANSWER: I just wanted the ability to type more than 300 characters about my original question and I did not see that option...hope I am not breaking the "rules."
I was able to download MMM. Once I did, I ran MMM.exe and opened my myApp.vbp. I ran through all of the steps and it created a new folder named MMMPack in my application folder. I then attempted to run the myApp.exe and the application starts but at some point during the load process, I receive a runtime error '339': Component 'vbalTbar.ocx' or one of its dependencies not correctly registered: a file is missing or invalid. I checked the MMMPack folder and verified that vbalTbar.ocx is in fact in the folder along with the manifest. Other files in the folder include: COMDLG32.ocx, MSCOMCTL.ocx, Msmask32.ocx, vbalTbar.ocx, xarraydb.ocx, and other in house written and 3rd party dll's. With that result, I decided to create a dummy vb6 project and only include one in house dll. I ran the vbp through MMM and it created a MMMpack folder for that project. The resulting files were/are the project executable, manifest, and included dll. I tested this exe on my machine and it ran successfully. I then copied the folder to a clean Vista machine and ran the application. When the test application hit the included dll's code, it threw me a runtime error '429': ActiveX component cannot create object.
Any thoughts or suggestions on this?
Thanks in advance,
Steve
Unattended Make My Manifest is a remake of MMM that can be used to generate manifests in automated builds. It uses a script file to add depended COM components.