Executing VB6 exe in non-VB environment - vb6

I have created a Vb application/exe using ADODC components and common dialog box. but I am not able to run that application on another PC where VB6 is not installed.
Do I have to install some additional components on that PC? (Don't want to install VB6 there).
How can I configure ODBC connection using code which we do manually from Control Panel -> Administrative Tools -> Data Sources -> Add new -> mdb ?

You should use the VB6 Package & Deployment wizard to generate an installer that will embed all the requirements and dependencies that your application needs to run.
That wizard is part of the VB6 development environment. Check the VB Start menu folder to find it.

Install the comdlg32 manually following the instructions on this site
http://devonenote.com/2010/02/register-comdlg32-ocx-on-x64-win7/
comdlg32 was not included in Vista and up.
NOTE Notice the different location to drop the file if it is a 64bit OS. And it may require you to run regsvr32.exe as administrator. Just follow the instructions on the link above. Should work.

Related

Visual Studio Advanced Installer - Install a Windows Service with build transforms

I have a .Net 4.7 application which is developed as a windows service. I have an MSI project which does the installation and there is a post install activation script that also gets executed (manually).
I am trying to replicate the old installer using the Advanced Installer Extension in Visual Studio and cant resolve these issues.
The first one is how do I stop Advanced Installer from creating multiple subdirectories in the target installation location. The install parameters have the Application folder set to [ProgramFilesFolder][Manufacturer][ProductName] however, I am getting [ProgramFilesFolder][Manufacturer][ProductName][ProductName]. I have the project Output under the Application folder in the files and folders tab.
Secondly, how do I install the application as a Windows Service. I can see this in the external version of Advanced Installer when I create a new package, but can't find the settings for the one within Visual Studio for the existing package.
Within Advanced Installer extension for VS you cannot configure the install location template, nor a service installation. As you already noticed those settings are available only in the desktop version of Advanced Installer.
As a workaround you can use the [Edit in Advanced Installer] button from VS and then edit the install location template from Install Parameters view in Advanced Installer desktop app.
Also, while in Advanced Installer desktop app you can configure a service installation as exposed in this tutorial.

Software Installer package with database integration issue

Recently by using Visual Studio 2013 I have developed a program that displays alarm information based on its time and alarm tone settings. Those settings and files are stored in MySQL database.
The issue is:
Is there any way to install this application to another computer without requiring to export the database, install MySQL database and configuring it.
Just I want to Install the required database file and application at ones including to the Software installation package. or what you will advice me.
Using the Installshield Lite packaged with VS2013 you can create a setup that will include the setup of applications such as MySQL.
When the setup runs, it will install MySQL with the parameters provided. If you configure the application to use silent install as discussed here: https://dev.mysql.com/doc/refman/5.1/en/windows-installer-msi-quiet.html then the installation will be seen as 'part of' your setup.
For the settings, I would recommend creating a setup application (console app) that will read a .sql file etc and configure the database. This too can be run as a pre-requisite of your installation.
You can also do this all manually (i.e. write your own setup application that will call MySQL setup using Process class, install MySQL, create project folder, create shortcuts etc). The Installshield is not fully functional and a gets a lot of bad press, but will do the job for a quick/simple install.

windows service msi installer created in vs2003 hangs in win7 while installing

We have few windows services developed using .Net framework 1.1(VS2003).For each windows service an msi installer(set up project) is created to make installation easier.These installers are able to install windows services successfully in windows XP.But these installers unable to install windows service in WIN7 though I have admin privileges on the machine in which I am trying install them.While I am trying to install the windows service in win7, Through msi installer,installation is progressing till 90%.After that it is neither completing nor throwing an error.I am unable to understand what the problem is.
I tried following ways.
1.Opened cmd window in admin mode and tried to execute the msi with the command msiexec -i --Din't work
2.Right clicked on the actual exe(windows service exe) file and tried to run it in admin mode.--Din't work
3.Changed the UAC to never notify, restarted the machine and then tried to install--Din't work
4.Right clicked on both exe and msi and open their properties and changed the compatibility to lower version of windows and tried to install--Din't work
One thing I have noticed is that for all the custom actions of our windows service installer, primary output of our main project(exe) was given as input.I build the msi installer by removing all the custom actions.Then i tried to install it in win7.Then it was installed.But during the installation system not prompted for account details (which is the actual case while installing windows service) and also the service was not appeared in services manager window.
I spent somuch time to identify the cause and resolution.But I dint find any posts on this issue.I suspect that the problem is with custom actions.But not sure.If the problem is with custom actions please let me know how to overcome it.
Please provide a resolution for this issue or share me if there are any links which talks about this.
FWIW, .NET 1.1 isn't supported on Win7. Also I'm guessing you are using InstallUtil custom actions to drive the setup of your .NET Windows Service. These are very fragile and you can eliminate all those brittle points by refactoring and using the ServiceInstall ServiceControl tables in MSI.

Is it InstallShield Express 4 or Windows 7 causing me issues when I install a VB6 application

I'm using a very old version of InstallShield Express 4 to package my VB6 application. Installing it on XP, it works great. But when I install it on a Windows 7 box, not using the "run as administrator", everything seems to be read-only. I can't edit an INI file because access is denied. The application just doesn't function properly. It's almost like it can't even access the folder. And it's installed in the default "program files" folder. I uninstall the application, reinstall using the "run as administrator" option, set compatibility of the short cut to "run as administrator", and everything works fine.
My question is this something inherited in VB6 where the application has to run as administrator or is it an InstallShield issue? And if it is an InstallShield Express issue, would the latest version of InstallSheild Express 2012 fix this? I would prefer the user not have to worry about installing or running the application as an administrator.
Nothing is specifically wrong with your VB6 application. I would say it's the older version of InstallSheild which might be the problem in this case.
The feature is called User Access Control (UAC) that has been introduced in Windows Vista and the following Microsoft operating systems to prevent arbitrarily write access into %ProgramFiles% by applications. You can still perform it manually (by copying and pasting files into %ProgramFiles%) but UAC will prompt for your permission.
To make sure your application behaves expectedly, save application settings in %APPDATA% or in registry, NOT in %ProgramFiles% directory. During installation or uninstallation of your program which requires write access into %ProgramFiles%, you'll have to run it as administrator (unless of course you have UAC disabled which is a massive security risk and strongly recommended against).
Yes, there is something specifically wrong with your VB6 app. It is storing its data in the wrong place. Your application cannot access the program files folder, unless it is running as administrator. This is due to User Account Control, as explained in gsabil's answer.
Here are some solutions (the best one last)
Always run the VB6 app as administrator.
Turn User Account Control off. This opens some security holes and is not recommended
Make your install program change the permissions on your installation directory, granting write access for all users. This is rather a hack, but it could be a fast way to get your program working
Change your application (not your install program) so that it stores its data in %AppData% rather than in the installation directory. This is preferable. Here is some detailed advice on how to do this in VB6

VB6 Application Silently Crashes on Startup/Form Loading

I have a VB6 app that loads initially (for a small prompt to enter a license key, only on the first time). It works fine on my machine (windows 7).
I had complaints of it crashing on someone else's machine (both xp and 7), so I made a Windows XP virtual machine. I installed it on the virtual machine, it crashed. I wanted to see where it crashed so I installed Visual Studio on the virtual machine so that I would get a debug prompt. When I ran the program again, it worked.
I am more familiar with C++ and had these kinds of problems, so I figured it was some sort of runtime issue.
I found this VB6 SP6 Redistributable Runtime:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24417
I installed that, and it still wouldn't run.
Any ideas where to go from here?
Edit:
I have tried depends.exe, it only shows MSJava, which I've heard I can ignore. Does depends.exe also show things like .ocx (Active X controllers?) that are required?
Also, from the cmd prompt, %errorlevel% doesn't seem to get populated. Is that a VB6 things, or does that indicate that this is truely a crash and not a user exit?
Open the Visual Basic project and check both "References" and "Components" under the "Project" menu.
Since it is crashing with the VB runtime installed it is likely a component that you have referenced in the project that either does not exist (or is not registered) on the client under test.
This should be a simple fix.
I had the same problem on my windows 7 computer.
I have uninstalled everything, changed my windows theme to Windows Classic.
I changed following properties of VB setup file.
Right click on setup.exe and go to properties and in compatibility tab change the compatibility mode to windows XP SP2. And in settings uncheck the following check boxes.
Disable Visual themes
Disable Desktop composition
Disable display scaling on high DPI settings.
Run this program as an administrator
And have completed installation.
Followed by installing VB 6 service pack 6 from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=24417
Hope it helps.
It may require something else other than just the runtime, have you tried viewing it with dependency walker http://www.dependencywalker.com/ on the machine that it crashes on?
It should quickly point out any missing references.
Maybe try again, create a new VM, but install the remote debugger instead of the full VS.
You should create an installer for your application. There may be more dependencies than just the VB6 runtime. A good installation tool will detect at least some of necessary dependencies for you. Have a look at this question or this question

Resources