Program Files (x86) problem - windows

I have an installer package, at the last step user can select launch application or not. the installed application is 32bit, during the installation we select the installation folder to "c:\Program Files", while it will always install application to "c:\Program Files(x86)" folder, then we meet problem, we can not launch the application, we have tested that if we choose the default installation folder(which means c:\program files") it works well. so I guess the problem is that windows launch 32bit application as 64bit, so it failed. how to solve it?

Your installer should know the path the application was installed to. You should use it, your EXE file key; for a WiX example see Well Done section of the tutorial.
If your installer package is MSI-based, then the installer is a 64 bit process, and it sees both Program Files (x86) and Program Files. I think it is the problem why you can't start your program. (A 32 bit executable will see only Program Files (x86) under the name of Program Files).

Related

VB6 compiling via console (vb.exe) compatibility issue on 64bit (works on 32bit?)

I'm using
cd C:\Program Files (x86)\Microsoft Visual Studio\VB98
vb6.exe /make Project1 /out %1
To basically compile my application, and I'm getting a compatibility issue (Saying doesn't work on my type of windows).
When compiling with the VB6 IDE (Make .exe) that works perfectly on my machine but this isn't, does anybody know how to fix this? Thanks
Error I receive when trying to open executable: "This version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 32-bit or a x64 64-bit version of the program, the contact the software publisher".
& It's a standard EXE application also.
I've tried running it as a administrator, trouble shooting / changing the compatibility to windows XP service pack 2 & 3, still didn't work.
Work prefer a good fix to this, like if there's anything I can do via console as a option or something or some option or anything.
Cheers! Please help ASAP
From the discussion in the comments, I believe the answer here is as follows (as identified by GSerg):
The problem is your use of the /make switch on the command line. The documentation says this about /out:
Outputs errors to a file when used with the /make or /makedll switch.
So, if you used vb6.exe /make Project1 /out Project1.exe, then Project1.exe would actually be a text file containing the error output from the compiler and thus would not be an actual executable, even though it had an .exe extension.
You actually don't specify the output binary when you use /make. The help output from running VB6.exe /? is a little more explicit:
Tells Visual Basic to compile projectname and make an executable file
from it, using the existing settings stored in the project file.
VB remembers the last filename and directory you used for compiling your project in the IDE, and it stores that in the .vbp file:
ExeName32="Project1.exe"
Path32="..\output"
I use a batch file to handle this issue. It sets the path to include both the 32-bit and 64-bit versions of the Program Files directories. Then just reference 'vb6.exe' and the correct one will be pulled from your path.
set PATH=c:"\Program Files (x86)\Microsoft Visual Studio\VC98\bin"
set PATH=%PATH%;c:"\Program Files (x86)\Microsoft Visual Studio\VB98"
set PATH=%PATH%;c:"\Program Files\Microsoft Visual Studio\VC98\bin"
set PATH=%PATH%;c:"\Program Files\Microsoft Visual Studio\VB98"
vb6 /m foobar.vpb

VB6 - After compiled getting compatibility issue on Windows 7 64bit [duplicate]

I'm using
cd C:\Program Files (x86)\Microsoft Visual Studio\VB98
vb6.exe /make Project1 /out %1
To basically compile my application, and I'm getting a compatibility issue (Saying doesn't work on my type of windows).
When compiling with the VB6 IDE (Make .exe) that works perfectly on my machine but this isn't, does anybody know how to fix this? Thanks
Error I receive when trying to open executable: "This version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 32-bit or a x64 64-bit version of the program, the contact the software publisher".
& It's a standard EXE application also.
I've tried running it as a administrator, trouble shooting / changing the compatibility to windows XP service pack 2 & 3, still didn't work.
Work prefer a good fix to this, like if there's anything I can do via console as a option or something or some option or anything.
Cheers! Please help ASAP
From the discussion in the comments, I believe the answer here is as follows (as identified by GSerg):
The problem is your use of the /make switch on the command line. The documentation says this about /out:
Outputs errors to a file when used with the /make or /makedll switch.
So, if you used vb6.exe /make Project1 /out Project1.exe, then Project1.exe would actually be a text file containing the error output from the compiler and thus would not be an actual executable, even though it had an .exe extension.
You actually don't specify the output binary when you use /make. The help output from running VB6.exe /? is a little more explicit:
Tells Visual Basic to compile projectname and make an executable file
from it, using the existing settings stored in the project file.
VB remembers the last filename and directory you used for compiling your project in the IDE, and it stores that in the .vbp file:
ExeName32="Project1.exe"
Path32="..\output"
I use a batch file to handle this issue. It sets the path to include both the 32-bit and 64-bit versions of the Program Files directories. Then just reference 'vb6.exe' and the correct one will be pulled from your path.
set PATH=c:"\Program Files (x86)\Microsoft Visual Studio\VC98\bin"
set PATH=%PATH%;c:"\Program Files (x86)\Microsoft Visual Studio\VB98"
set PATH=%PATH%;c:"\Program Files\Microsoft Visual Studio\VC98\bin"
set PATH=%PATH%;c:"\Program Files\Microsoft Visual Studio\VB98"
vb6 /m foobar.vpb

If an application is built on a 32-bit machine, when run on a 64-bit machine, how does it look for DLLs?

If an application is built on a 32-bit machine, when run on a 64-bit machine, how does it know the .dll is in C:\Program Files (x86) instead of C:\Program Files or it doesn't?
ERROR SUMMARY
[SCRIPT]: File not found: C:\Program Files\Common Files...\abc.dll.
However, in my 64-bit machine, abc.dll is in C:\Program Files (x86)\Common Files...\abc.dll
If it doesn't, where do I adjust the path because apparently it's not in the application's code.
First of all, you can cross-compile in either direction so being built on a 32-bit machine doesn't necessarily mean anything. It is really an issue of running 32-bit code on a 64-bit machine. In this case, there is a 32-bit emulation layer on 64-bit installations called Wow64. Part of this is file system redirection, which redirects file system requests from 32-bit programs. In this case, trying to access "C:\Program Files" from 32-bit code will transparently redirect to "C:\Program Files (x86)".
it doesn't?
No part of the default search path checks anywhere in Program Files or Program Files (x86) unless it is because the directory of the application is under one of those folders.
If you are getting that error from a 32bit application then something is set up unusually (like overriding the default install location under Program Files (x86)).

Register comdlg32.dll gets Regsvr32: DllRegisterServer entry point was not found

I have Windows 7, 64-bit.
I'm trying to register a .dll (comdlg32.dll) using regsvr32. But I get an error that says the dll is read but the DLLRegistryServer entry point is not found.
I have run the command under both System32 and SysWOW64 and I have run my commands with "Run As Administrator".
My old MSComDlg.CommonDialog component is no longer working with 64-bit.
comdlg32.dll is not a COM DLL and cannot be registered.
One way to confirm this for yourself is to run this command:
dumpbin /exports comdlg32.dll
You'll see that comdlg32.dll doesn't contain a DllRegisterServer method. Hence RegSvr32.exe won't work.
That's your answer.
ComDlg32.dll is a a system component. (exists in both c:\windows\system32 and c:\windows\syswow64) Trying to replace it or override any registration with an older version could corrupt the rest of Windows.
I can help more, but I need to know what MSComDlg.CommonDialog is. What does it do and how is it supposed to work? And what version of ComDlg32.dll are you trying to register (and where did you get it)?
comdlg32.dll is not really a COM dll (you can't register it).
What you need is comdlg32.ocx which contains the MSComDlg.CommonDialog COM class (and indeed relies on comdlg32.dll to work). Once you get ahold on a comdlg32.ocx, then you will be able to do regsvr32 comdlg32.ocx.
Registering DLL for Fundsite
Outdated or missing comdlg32.ocx runtime library can be the problem of causing this error.
Make sure comdlg32.ocx file is not corrupted otherwise Download the File comdlg32.ocx (~60 Kb Zip).
Download the file and extract the comdlg32.ocx to your the Windows\System32 folder or Windows\SysWOW64. In my case i started with Windows\System32 but it didn’t work at my end, so I again saved in Windows\SysWOW64.
Type following command from Start, Run dialog:“c:\windows>System32\regsvr32 Comdlg32.ocx “ or “c:\windows>SysWOW64\regsvr32 Comdlg32.ocx ”
Now Comdlg.ocx File is register and next step is to register the DLL
Copy the Fundsite.Text.Encoding. dll into .Net Framework folder for 64bit on below path
C:\Windows\Microsoft.NET\Framework64\v2.0.50727
Then on command prompt and go to directory C:\Windows\Microsoft.NET\Framework64\v2.0.50727 and then run the following command as shown below.
This will register the dll successfully.
C:\Windows\Microsoft.net\framework64\v2.0.50727>regasm "Dll Name".dll
Have you unistalled your Internet Explorer?
I did, and I had the same issues, if so, you have to:
Reactivate IE (Control Panel -- Programs and Features -- Turn Windows features on or off).
restarting the computer
(important!) running Windows Update to get all available updates for Microsoft Explorer
restarting the computer (again)
Finally it works!
I have faced the same issue with COMDLG32.OCX and MSFLXGRD.OCX in Windows 10 and Visual Studio 2010. It's an MFC application.
Then I downloaded its zip file from the google after extracting copy them at following paths:
C:\Windows\System32 (*For 32-bit machine*)
C:\Windows\SysWOW64 (*For 64-bit machine*)
Then run Command Prompt as an Administrator then run the following commands:
For Windows 64-bit systems c:\windows\SysWOW64\ regsvr32 comdlg32.ocx
c:\windows\SysWOW64\regsvr32 msflxgrd.ocx (My machine is 64-bit configuration)
For Windows 32-bit systems c:\windows\System32\ regsvr32 comdlg32.ocx
c:\windows\System32\regsvr32 msflxgrd.ocx
On successfully updation of the above cmds it shows succeed message.
Information about missing entry point error installing legacy VB6 compiled applications on Windows 10 which I hope could be useful to someone.
Missing OCX files can be found in the "OS\System folder" of the Visual Basic 6.0 installer package.
Today I copied the relevant OCX file (from our network) to the local computer
And then I typed the commands below, as administrator, which normally work to register it.
cd \windows\syswow64
regsvr32.exe /u mscomctl.ocx
regsvr32.exe /i mscomctl.ocx
(add the path to the locally copied file for the /i command)
However today I got errors from both these regsvr32.exe commands.
The second error was giving the DllImport missing entry point error which is similar to the error mentioned by the original poster.
To resolve, one of the things I tried was leaving out the switch -
regsvr32.exe mscomctl.ocx
To my surprise it then said it was successful.
To confirm, the application started up properly afterwards.
SOLUTION OF Regsvr32: DllRegisterServer entry point was not found,
Go to systemdrive(generally c:)\system32 and search file "Regsvr32.exe"
Right click and click in properties and go to security tab and click in advanced button.
Click in owner tab and click edit and select administrators and click ok.
Click in permissions
Click in change permissions.
Choose administrators and click edit and put tick on full control and click ok.
Similarly, choose SYSTEM and edit and put tick on full control and click ok and click in other dialog box which are opened.
Now .dll files can be registered and error don't come, you should re-install any software whose dll files was not registered during installation.
I also had the similar problem while registering myinfo.dll file in windows 7. Following work for me:
Create a short cut on your desktop
C:\Windows\System32\regsvr32.exe c:\windows\system32\myinfo.dll
right click on the short cut just created and select as Run as administrator.

How to package stand alone exe inside Visual Studio Installer maker?

Im currently using Visual Studio Installer to package my dll program. How to include stand alone executable program inside my installer project? Since my dll is using the exe(s) in order to run.
Note: For my development platform, I already have the exe(s) inside my c:\ directory. So I would like my installer to also copy the exe(s) to c: drive of other user's platform when they run my installer.
Add the required exe during making the installer to the Application Folder.
Then change all the path that points to those required exe(s) so that it points to the exe(s) in the Application Folder. Shown below:
Instead of "C:\directory\file.exe" to Application.StartupPath & "\file.exe"
Application.StartupPath returns the path of the executable file that started the application.
So if you app is installed in "C:\Program Files\MyApp\program.exe" this would return "C:\Program Files\MyApp"
I hope this helps.

Resources