From: Neal Bade on
I have a printer driver that installs just fine on all
OS's except Windows 7 x64 (Windows 7 x86 works).

As a convenience to the printer manufacturer, I package
the driver files in a self-extracting EXE. As part of the
extraction process the last thing is to run the following
command line:

rundll32 printui.dll,PrintUIEntry /ii /f driver.inf

When run on Windows 7 x64 the following message box appears:

Windows can't open Add Printer.
Operation could not be completed (error 0x0000007E)

Funny thing is, if I enter this command line from a command
window in the folder where the files are extracted, then it
works fine. It only seems to fail when run as part of the
extraction process.

Any ideas?

Neal Bade
Tharo Systems, Inc.
www.tharo.com
From: Mike [MSFT] on
Is the self-extracting EXE 64-bit? I believe this would fail if initiated
from a 32-bit process.

-Mike

"Neal Bade" <neal(a)tharo.com> wrote in message
news:#w42syRpKHA.4836(a)TK2MSFTNGP05.phx.gbl...
> I have a printer driver that installs just fine on all
> OS's except Windows 7 x64 (Windows 7 x86 works).
>
> As a convenience to the printer manufacturer, I package
> the driver files in a self-extracting EXE. As part of the
> extraction process the last thing is to run the following
> command line:
>
> rundll32 printui.dll,PrintUIEntry /ii /f driver.inf
>
> When run on Windows 7 x64 the following message box appears:
>
> Windows can't open Add Printer.
> Operation could not be completed (error 0x0000007E)
>
> Funny thing is, if I enter this command line from a command
> window in the folder where the files are extracted, then it
> works fine. It only seems to fail when run as part of the
> extraction process.
>
> Any ideas?
>
> Neal Bade
> Tharo Systems, Inc.
> www.tharo.com

From: Neal Bade on
The self-extracting exe is most certainly 32-bit. I created
it using PackageForTheWeb, an old InstallShield add-on.

As a quick test, I wrote small x64 app to call CreateProcess
using same command line as before. CreateProcess does not
return any error, but "Add Printer" does not start either.

Don't know where to proceed from here...

Neal

Mike [MSFT] wrote:
> Is the self-extracting EXE 64-bit? I believe this would fail if
> initiated from a 32-bit process.
>
> -Mike
>
> "Neal Bade" <neal(a)tharo.com> wrote in message
> news:#w42syRpKHA.4836(a)TK2MSFTNGP05.phx.gbl...
>> I have a printer driver that installs just fine on all
>> OS's except Windows 7 x64 (Windows 7 x86 works).
>>
>> As a convenience to the printer manufacturer, I package
>> the driver files in a self-extracting EXE. As part of the
>> extraction process the last thing is to run the following
>> command line:
>>
>> rundll32 printui.dll,PrintUIEntry /ii /f driver.inf
>>
>> When run on Windows 7 x64 the following message box appears:
>>
>> Windows can't open Add Printer.
>> Operation could not be completed (error 0x0000007E)
>>
>> Funny thing is, if I enter this command line from a command
>> window in the folder where the files are extracted, then it
>> works fine. It only seems to fail when run as part of the
>> extraction process.
>>
>> Any ideas?
>>
>> Neal Bade
>> Tharo Systems, Inc.
>> www.tharo.com
>
From: "Check Abdoul" checkabodul at mvps dot on
0x0000007E is ERROR_MOD_NOT_FOUND. Run process explorer and to find out
which module is missing.

Cheers
Check Abdoul

"Neal Bade" <neal(a)tharo.com> wrote in message
news:%23w42syRpKHA.4836(a)TK2MSFTNGP05.phx.gbl...
>I have a printer driver that installs just fine on all
> OS's except Windows 7 x64 (Windows 7 x86 works).
>
> As a convenience to the printer manufacturer, I package
> the driver files in a self-extracting EXE. As part of the
> extraction process the last thing is to run the following
> command line:
>
> rundll32 printui.dll,PrintUIEntry /ii /f driver.inf
>
> When run on Windows 7 x64 the following message box appears:
>
> Windows can't open Add Printer.
> Operation could not be completed (error 0x0000007E)
>
> Funny thing is, if I enter this command line from a command
> window in the folder where the files are extracted, then it
> works fine. It only seems to fail when run as part of the
> extraction process.
>
> Any ideas?
>
> Neal Bade
> Tharo Systems, Inc.
> www.tharo.com


From: Neal Bade on
I managed to get self-extracting exe to invoke the "Add Printer"
wizard by starting a 64-bit executable that calls rundll32 and
passes the "printui.dll,PrintUIEntry" command line.

Unfortunately, after the driver is installed, the Windows
"Program Compatibility Assistant" pops up a dialog box that
says "The program might not have installed correctly".

I did some research on MSDN regarding the PCA (Program compatibility
assistant) and I quote:

"The best option to exclude a program from PCA is to include, with the
program, an application manifest with run level (either Administrator or
as limited users) marking for UAC. This marking means the program is
tested to work under UAC (and Windows Vista and Windows Server 2008).
PCA checks for this manifest and will exclude the program."

So I added a program manifest for the self-extracting exe, with the
relevant parts being:

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"
uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

This does not seem to affect the PCA at all. I still get the annoying
dialog box about the program not being installed correctly.

Any ideas?

Neal Bade
www.tharo.com