VB6 Deployment not working for Second user - windows

I have a VB6 Application that I am deploying using Microsoft Development Environment.
The install package is working for Windows 7/10 32/64 bit.
The problem I am having is if a second user logs into windows and runs the installed app some of the controls are not working.
Forms that contain MSCOMCT2.OCX, TABCTL32.OCX and maybe others fail saying:
"Component ... or one of is dependencies not correctly registered: a file is missing or invalid"
But once again for the user that installed the app all is good.
I see in other installs there is a choice to install for only me or all users. I don't see a way to implement that in "Microsoft Development Environment", is this my problem?
What changes if you install an app for All users?

This may have to do with registry virtualization. The application may be running in some kind of compatibility mode so that the controls are not really being installed system-wide.
I'm not too familiar with those settings but it might be possible to adjust them so that the DLLs/OCX files are genuinely registered for all users and the application runs accordingly. There is a risk that if the compatibility settings were set intentionally, this could break something else.
Hopefully this is a useful starting point.
I will add that IMO installing the application not to require registration whatsoever is a much more robust solution. See How can you force VB6 to use the DLLs and OCXs from the app directory?

Related

Issues updating an MSI through GPO (failures to overwrite/uninstall)

Thank you in advance for considering this question. If a similar question existed, I was unable to find it.
The Issue: Our company packages an application into an MSI. This MSI when installed outside of any GPO properly updates, blocks attempts to downgrade (or move from a higher revision to a lower revision), and never has trouble uninstalling previous versions of the application regardless of how long ago those versions were created/installed. For example, we can install version 1.2.3 and then install version 2.3.4 and the application will properly install without issue. However, we work with a customer who uses GPO to deploy our application to hundreds of PC's. Each time we have provided an updated version of the application the following has been indicated:
On any machine where a previous version of our application was installed via GPO, no matter what the previous version is, the update successfully installs without issue.
On a machine where the application was manually installed (outside of the GPO), and an attempt to update the application via GPO is made - either the application is installed in addition to the old version, OR there remain registry keys to the previous version of the application and the application cannot open/run correctly. In this case the registry keys must be manually removed, and the install is then attempted again from a clean machine.
What we know is that on any machine where the application was originally installed via GPO - updating the application is no problem. On every machine where the application was not installed with the GPO in the first place, updating via GPO fails with one of the problems presented above.
My question is: Is there a technical issue with how the installation is being handled partially through the GPO and partially outside? Does the GPO need to be responsible for the entire life-cycle of the application? OR is it a reasonable expectation that the application be updated both on machines where the original version was manually (outside the GPO ) installed, and when it was installed initially from within the GPO?
One solution we are aware of is simply having all computers manage the application life-cycle (since we know updates work in that environment already), however this would mean that many computers would need to have the manually installed versions removed by hand - and then properly handle the installation through GPO which is an extensive bit of work.
We would greatly welcome any solutions, references to technical documentation that formally shed light on the proper management or expectations here, or links to information. Our research suggests that it is "best" to manage the entire applications life-cycle inside the GPO - but I have as of yet been unable to determine that it is 100% necessary to do so.
Looking forward to any assistance. If any further technical details are required to help the viability of the question, please don't hesitate to request such details.
If you end up with two versions installed in Control Panel, then all other things being correct, the most likely explanation is that you upgraded a per user install with a per machine install (or vice versa). In the GPO world that's related to assigning it to a user or to the computer, something like that. That's easy to verify by getting a verbose log and checking the FindRelatedProducts actions for an indication that another product was found but in a different context.
When you're in GPO mode all the time, I assume each one (whether it's per user or per machine) is consistent, therefore upgrades always work, but they don't work cross-context.
I believe GPO suppresses the UI in most cases, and the UI (or the UI sequence) is sometimes where per user/per machine is set. That might be something else that would cause it, depending on how the GPO publishes to the computer or the user.

Vb6 component on Windows 2003 R2 won't register

I'm trying to deploy some Vb6 components on a Windows Server 2003 Standard x64 R2. I normally run these in a com+ application and I went through the normal routine of creating the COM+ application and adding all the components. Everything seemed to work fine until I actually tried to use any of the components. I would some kind of "ActiveX component can't create object" or "Application-defined or object-defined error" or something similar to that.
To remove as many variables a possible I created a very simple VB form to consume the simpliest of the components and tried that. Nope. So I created a simple install to install the component, and whooo hoooo it worked. So I tried one of the more envolved components with high hopes ... but no after the install I still can't call the component successfully. Using Dependency Walker I discovered that for some reason the msvbvm60.dll is not properly registerd.
I've downloaded VBRUN60.exe and VBRUN60SP6.exe and tried installing them. Even going so far as to do a run as with the administrator account and removing the check box for "Run this program with restricted access". I've tried to manually register the msvbvm60.dll in the SysWow64 directory.
Nothing seems to work. It just won't register. Does anybody have any suggestions? At this point I'll try just about anything.
Thanks
If you are registering the components manually you need to pay extra attention. As you are on a 64-bit OS there are two versions of regsvr32.exe. When registering VB6 components you must make sure to use the 32-bit version of regsvr32, which is located under the following location:
%WINDIR%\SysWOW64\regsvr32.exe
If you just type regsvr32 on the command prompt, normally the 64-bit version is chosen (because %WINDIR%\system32 is contained in the %PATH% environment variable), so please make sure to use the full path as above.
If you are using a 32-bit MSI to install your components, this version will be selected automatically and the registration should work just fine.
In case you haven't already done, you should give a try to Process Monitor - one of the best tools I have used on dll registering problems.
The following links will provide some usufull clues:
An excelent tutorial on using Process Monitor for problem solving;
ActiveX component can't create an object
RESOLVED! ActiveX Component Can't Create Object: Cube build failure against SQL Server 2005 Analysis Services
Hope it helps :D
I've had trouble with unregistered components for Visual Basic 6 - although not tried to use the same one as you are mentioning. Manually registering never resolved things, no matter which reg server was used
The problem (eventually) turns out to be Internet Explorer 10. Uninstalling that (due to the way Windows 7 handles IE as Windows updates, this meant unistalling newer versions first to expose the older ones) worked. Afterwards, reinstalling the latest IE brings no problem.

How to automatically run a VB6 compiled software as Administrator and in Compatibility mode

We have an ERP application which is built in VB6 and it was running just fine till a few of our customer upgraded all their systems to Win7.
This software is programmed in such a way that it registers a few plugins (found in plugin folder) which are COM based at runtime. Now when the software is run by user without setting Compatibility Mode and Run as Administrator setting it fails and crashes.
I know we can manually set both Compatibility Mode as well as Run a Administrator by right clicking on program executable and then going to its properties. But this looks very unprofessional.
I think there will be some way to tell Win 7 to automatically run a software in Compatibility Mode and Run as Administrator.
Please help me.
Compatibility is an administrative function, not a development or deployment function. It is better to fix the application where possible, especially to remove any requirement for elevation.
There are plenty of tools for investigating the issues so you can correct them. However globally registering "plug ins" at runtime is a nasty one. VB6 component self-registration is always global unless registry virtualization can redirect it. Why not create installers for the plug-ins that can run elevated once during installation?
There are ways to set compatibility less manually, even as part of installation - though Microsoft discourages this. Maybe take a look at:
Compatibility Fix Database Management Strategies and Deployment
However the effort required might be better spent on remediating the problem. Support costs will be less over time.
As the other answers have said, you shouldn't need to run all the time elevated.
If you want to register the plugins after its started (as a normal user), you can use ShellExecute() with the "runas" verb to run regsvr32.exe, or use COM elevation which has been discussed many times before.
You can indicate that an application must run as admin by specifying it in the Application Manifest, which in an xml file that you can either embed or deploy with your application.
Once your application is running with admin rights it should be able to register and load the plugins. You should not need to run in compatibility mode to access the COM plugins.

How do I deploy my xcode webplugin for safari?

I have a c project built into a .webplugin that works when I install it manually (i.e. copy it to the Library/Internet Plug-Ins folder) but how do I get this to users who visit the web site most expediently? From my investigation it sounds like one must build an installer that a user must download (as with flash, quicktime).
-Is there any way for it to install via the browser (Safari) as Activex controls do in IE?
-If I must build an installer, how would I begin?
-If I must use an installer, is there any way to detect if the plugin is already installed so that I can prompt the user accordingly?
Thanks very, very much for your time. This has been such a thorn in my side!
Is there any way for it to install via the browser (Safari) as Activex controls do in IE?
No. IE no longer supports this behavior for ActiveX anyway, as allowing any web site to install software on a user's computer is a massive security vulnerability.
Note in general that requiring an Internet Plugin to view your site will end up turning away a lot of viewers. Unless your web application has some really unusual needs, I'd question whether this is necessary -- JavaScript is capable of some really impressive things nowadays.
If I must build an installer, how would I begin?
Start here: PackageMaker User Guide (Mac OS X Developer Library)
If I must use an installer, is there any way to detect if the plugin is already installed so that I can prompt the user accordingly?
If you build an installer using PackageMaker, I believe the installer will detect this situation automatically.

What are the advantages of installing programs in AppData like Google Chrome?

I just noticed that Chromium was installed in AppData in both Vista and XP. If Google does that and if other applications does this, than is that becuase there is some form of protection? Should we write installers that does the same thing as Google?
Windows still lacks a convention for per-user installation.
When an installer asks whether to install for the current user or all users, it really only refers to shortcut placement (Start Menu; Desktop). The actual application files still go in the system-wide %PROGRAMFILES%.
Microsoft's own ClickOnce works around this by creating a completely non-standard %USERPROFILE%\Local Settings\Apps (%USERPROFILE%\AppData\Roaming on Vista / Server 2008) directory, with both program files and configuration data in there.
(I'm at a loss why Microsoft couldn't add a per-user Program Files directory in Vista. For example, in OS X, you can create a ~/Applications, and the Finder will give it an appropriate icon. Apps like CrossOver and Adobe AIR automatically use that, defaulting to per-user apps. Thus, no permissions issues.)
What you probably should do: if the user is not an admin, install in the user directory; if they do, give them both options.
One advantage nobody mentioned are silent auto-updates. Chrome has an updater process that runs all the time and immediately updates your chrome installation.
I think their use-case is non-standard. They need a way to fix vulnerability issues (since it's a browser) as soon as possible. Waiting for admins approving every single update company-wide, is simply not good enough.
As far as I can tell, the only reason why Chrome installs into the Application Data folder is so that non-admin users can install it.
The Chrome installer currently does not allow the user to pick where the application is to be installed. Don't do that – instead, give the user a choice between a per-user (somewhere like App Data) and computer-wide (Program Files) installation.
Windows 7 and Windows Installer 5.0 provide real per-user installation capabilities now.
http://msdn.microsoft.com/en-us/library/dd408068%28VS.85%29.aspx
You can sort of fudge it in Vista and XP by using ~/AppData/Local or the equivalent like Chrome does. Microsoft themselves use this for the ClickOnce installers.
So at least on Windows 7 and beyond the solution is simple.
Frankly, I have yet to see the first installer that really allows both per-user and per-machine installations. Many installers offer this option in their GUI, but the setting only affects where the shortcuts etc. go -- the binaries always fo to %ProgramFiles%.
In fact, it is pretty hard to create Windows Installer packages that allow both kinds of installs, to say the least. With the advent of UAC, I'd say its is impossible: Per user installations must not require elevation, per machine installations have to. But whether an MSI package requires elevation is controlled via a bit in the summary information stream -- there is no way to have user input have impact on that.
Whether per-user or per-machine is the better choice greatly deoends on the application. For small packages, however, I tend to prefer per-user installations. Besides being slightly more user-friendly by not requiring an UAC prompt or runas, they also signalize the user that the setup will not do much harm to the computer (assuming he is a non-admin).
The Chrome installer really ought to allow global installation (with elevation) in addition to per-user. I don't want to have to maintain an installation for every user; I want to be able to centrally manage upgrades and so on. Chrome doesn't allow that.
That said, the option to install per-user is quite nice, as it means no permissions issues.
Just so you people know, Google has created an MSI installer for global system installation and management. It's located here:
https://www.google.com/intl/en/chrome/business/browser/
I do not see anything in %PROGRAMFILES% on Win7. Looks like Chrome must be installed for each user on the machine.
Perhaps the true reason of doing this is faking number of Chrome installations by few times ! Thus making it first browser in the world !

Resources