Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

OLE2.DLL is not a valid Windows image

Created: 04 May 2009 • Updated: 21 May 2010 | 11 comments

Wise Installation Studio 7.3.0.250
WiseScript Package Editor
This is an EXE, not an MSI installation.

Error during install:
The application or DLL C:\WINDOWS\system32\OLE2.DLL is not a valid Windows image. Please check this against your installation diskette.

I've done some looking around and I see people talking about getting the error, but in most every case, other people are telling them this error can be ignored.   Well that may be great for some, but we're not releasing an installer to our client where this message could possibly show up.    We have installed our software on about 20 different machines with no issues, but as soon as we sent it QA, their environment threw this error.   Our software is all VC6 with only 2 EXE's in this package.  However, one of the EXE's is a Winows Service, but with no dependancies.   We are not using this OLE2.DLL, so it could only be coming from the installer itself.   On another note, this is a very old DLL and error message.   I found this on Microsoft: http://technet.microsoft.com/en-us/library/cc722047.aspx which says this is fixed with the use of a different API call, which seems to be from the installer.

In the mean time, how do I get around it?   Has anyone else fell across this issue?

Discussion Filed Under:

Comments 11 CommentsJump to latest comment

EdT's picture

Try the install using the base MSI rather than the EXE compilation - that will at least determine whether the issue is in the MSI or within the EXE compilation

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

.Chizl's picture

Thanks for the response, but I'm not sure how to do that.   Is there an option that says make it an MSI instead of a EXE or is this a complete rebuild with a different compiler?

EdT's picture

Didn't spot the fact that you were using Wisescript Editor.
Did you author this package with WIS7, or is this an old wisescript that you have recompiled ?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

.Chizl's picture

The guy that took over this project, which is no longer with the company, created it base on the older one, but started from scratch within Wise7.

.Chizl's picture

Ok, so I put a ton of Message Boxes in the installer to find where it was causing this issue.   The call for Self-Register OCX's/DLL's/EXE's is causing this error.

Since this is only 2 EXE's one being a service, I removed this and all seems to work just fine.   However, if I cancel the Install at the end, once everything has been installed, I see the error again.   I'm not using a custom Uninstall, I'm using the UNWISE32.EXE.   For some reason it feels it need to unregister my EXE's.

How can I tell it different to not do that?

AngelD's picture

Accoring to MS Article ID: 200918 it could be due to existing file.
If so; try removing it before installing & self-registering the OLE2.DLL.

.Chizl's picture

I'm not installing or registering the OLE2.DLL.  It's already there.   I was just saying I found code in the installer, which I assume is part of the create template for Wise Script Editor, that calls Self-Register and it's causing the error.   OLE2.DLL is a DLL that was used by Win95 to register objects.   It's better known as OLE32.DLL now.   It's an old DLL that windows left lying around and it seems Wise7 is using it.    Based on the Microsoft link I posted above, this error can be avoided by not calling the API that uses OLE2.DLL.  However that code is in the Wise Installer and I found a way to get around it for the installer, but when the UNWISE32.EXE is called, I'm still getting this error.

EdT's picture

Have you tried removing the self registration command altogether? If any of your files need registration, you could add a call to regsvr32.exe.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

.Chizl's picture

I removed it from the installer, but I'm still get it during the Uninstall, which I don't have custom uninstall.  So I dont control that code, I dont think, do I?

EdT's picture

Have a look in your installation log - any commands to unregister files should be visible in there, so at least you can tell if this is the issue.
On another thought - when you say you started this project from scratch, can I confirm that you never at any point imported the origina WSE file and then modified it in some way?

The older Wisescript editors could be set for 16 bit or true 32 bit compatibility, and if your old WSE file (or ipf file) was originally set to 16 bit operation, then re-using the WSE would almost certainly have preserved this setting in one of the flag bits, even though the WIS 7 product does not offer 16 bit compatibility any more. (I suspect the compiler still recognises the flag though)

You could compare flag bits by opening a current WSE template in a text editor and also your project's WSE, but if you started with a clean new template from WIS 7 then this would not be the issue.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

.Chizl's picture

The old version was from Wise 4 that was upgraded to 5.   I'm pretty sure he started from scratch.  I'm remembering him telling me that 7 wouldn't import a script that old.   Something about we would have to install version 6 to upgrade from 5 and then have 7 upgrade it to the latest.   We only own 7.  Another company entirely did the version 4 and 5 script.