Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-11 Thread Arthur, Christopher
Hi,

are you quite shure that the AddPrinter Method work in this case. I've checked 
the available Printers on a clean Windows 7 machine. The Printer driver is not 
there and can't be downloaded at HP. You have to install the Printer using the 
Windows Automatic Update.

Sincerly

Christopher Arthur


-Ursprüngliche Nachricht-
Von: Tom Brezinski [mailto:to...@networkinstruments.com]
Gesendet: Montag, 10. März 2014 17:14
An: General discussion about the WiX toolset.
Betreff: Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE 
instead of LPT1

I think you will need to write a custom action that uses the AddPrinter api.  
DIFxApp is probably out of the question since you don't have driver files.  HP 
says for that printer with all current versions of Windows to use the drivers 
included with the OS.

See AddPrinter:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183343%28v=vs.85%29.aspx


-Original Message-
From: Arthur, Christopher [mailto:christopher.art...@vaps.de]
Sent: Monday, March 10, 2014 10:04 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of 
LPT1

Hi,

what's the best way of Installing HP LaserJet 4 with wix ?
I've found no straight forward documentation to achieve my goal.


Sincerly

Christopher Arthur

Wichtiger Hinweis: Diese E-Mail und etwa angeh?ngte Dateien k?nnen vertrauliche 
Informationen enthalten und sind ausschlie?lich f?r den/die Adressaten 
bestimmt. Sollten Sie irrt?mlich diese E-Mail erhalten haben, bitten wir Sie, 
uns dar?ber zu informieren und die E-Mail aus Ihrem System zu l?schen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.
--
Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

--
Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Wichtiger Hinweis: Diese E-Mail und etwa angehängte Dateien können vertrauliche 
Informationen enthalten und sind ausschließlich für den/die Adressaten 
bestimmt. Sollten Sie irrtümlich diese E-Mail erhalten haben, bitten wir Sie, 
uns darüber zu informieren und die E-Mail aus Ihrem System zu löschen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-11 Thread Arthur, Christopher
Hi,

I've downloaded the driver package via Windows Update. So I've got the needed 
files to install the printer using DIFxApp.
In my Inf File are many different printer models listed. How do I select the 
correct one ?

I've found (Difxapp Extension) in Wix Documentations, but how do I use it to 
install my specific printer driver within the inf File.


Sincerly
Christopher

-Ursprüngliche Nachricht-
Von: Tom Brezinski [mailto:to...@networkinstruments.com]
Gesendet: Montag, 10. März 2014 17:14
An: General discussion about the WiX toolset.
Betreff: Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE 
instead of LPT1

I think you will need to write a custom action that uses the AddPrinter api.  
DIFxApp is probably out of the question since you don't have driver files.  HP 
says for that printer with all current versions of Windows to use the drivers 
included with the OS.

See AddPrinter:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183343%28v=vs.85%29.aspx


-Original Message-
From: Arthur, Christopher [mailto:christopher.art...@vaps.de]
Sent: Monday, March 10, 2014 10:04 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of 
LPT1

Hi,

what's the best way of Installing HP LaserJet 4 with wix ?
I've found no straight forward documentation to achieve my goal.


Sincerly

Christopher Arthur

Wichtiger Hinweis: Diese E-Mail und etwa angeh?ngte Dateien k?nnen vertrauliche 
Informationen enthalten und sind ausschlie?lich f?r den/die Adressaten 
bestimmt. Sollten Sie irrt?mlich diese E-Mail erhalten haben, bitten wir Sie, 
uns dar?ber zu informieren und die E-Mail aus Ihrem System zu l?schen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.
--
Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

--
Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Wichtiger Hinweis: Diese E-Mail und etwa angehängte Dateien können vertrauliche 
Informationen enthalten und sind ausschließlich für den/die Adressaten 
bestimmt. Sollten Sie irrtümlich diese E-Mail erhalten haben, bitten wir Sie, 
uns darüber zu informieren und die E-Mail aus Ihrem System zu löschen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-11 Thread Phill Hogland
Regarding how to use the DifxExtension if you have the driver files, create a
msi which installs the drivers files to a cache location.  (At that point
you, in general for any driver prior to using the DifxApi, you should be
able to right click on the INF file and see the driver successfully install. 
If you can't accomplish that step there is no point in authoring the DifxExt
yet IMO.)  Also for my drivers which support both x86 and x64, I structured
the msi to be build twice in either configuration, installing all files,
because of signing, to either the appropriate programfiles tree.  Then add
the DifxExt schema to the wxs file which contains the INF file component,
and add the difx:Driver element to the component which has the INF file. 
(I'm sure there may be other approaches.)
http://www.codeproject.com/Articles/44191/Drivers-Installation-With-WiX

Regarding the printer driver and configuring for 'print-to-file', I am
working on a similar requirement.  I found that I could not use the
DifxExtension for this purpose.  I will later also work on a project that
requires the printer driver to be installed for PNP connection of of the
printer device, and based on preliminary testing I think the DifxApp
extension may work in that situation.  I have three different printer
drivers (six platform variants), which I deliver as part of my suite.  For
this project each is configured for 'print-to-file'.  One of the drivers is
based on an HP engine (and includes the HP driver).  Yes you could implement
a CA to call the AddPrinter, and related Print Spooler api functions which
you will also need.  (I created a setup application used in a non-wix
process some time ago which takes that approach.)  However the approach I
have settled on is to call the PrintUI dll.
http://technet.microsoft.com/en-us/library/ee624057.aspx

Both AddPrinter (and related functions) and the PrintUI dll docs warn that
the calls may bock, but I decided that using PrintUI which is well tested,
is more reliable than me rolling my own setup application and maintaining
changes over time.  I am working on an extension which is not ready to be
submitted back to the community yet, but I know that this approach can be
achieved.  (I originally implemented the approach as a custom table driven
CA, while I also worked on issues getting even sample extension code to
compile.)

When I tried to first call Difxapp Extension and then call PrintUI in the
same Component/msi, it always fails. I had to abandon calling DifxAPP
(Ext).  While DifxAPP is the recommended approach in many situations, it is
not intended to be used in some scenarios.  In an earlier non-wix setup I
have called DifxAPI to put the driver in the Driver Store and then PrintUI
to install the driver and configure as 'print-to-file' which has been a
reliable approach for years.  There also in a non-msi setup, the DifxAPP was
not useful.  I have not implemented anything to call DifxApi in wix yet, but
I plan too.  All of my drivers are fully signed PNP drivers which have been
deployed for years (and are not open for changes related to this wix
project).

Additional reading:
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Strange-problem-with-printer-driver-installation-td7591538.html



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Installing-HP-LaserJet-4-Printer-Driver-on-FILE-instead-of-LPT1-tp7593244p7593283.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-11 Thread Phill Hogland
Here are the PrintUI commands that I use.  I would test your parameters on a
target machine in a admin CMD box prior to integrating into a msi.
LPWSTR pwzAddPrinterCommand = L\%lsRunDll32.exe\
PrintUI.dll,PrintUIEntry /if /b \%ls\ /f \%ls\ /r %ls /m \%ls\ /u /q
/z /Gw;
LPWSTR pwzDelPrinterCommand = L\%lsRunDll32.exe\
PrintUI.dll,PrintUIEntry /dl /n \%ls\ /q /Gw;
LPWSTR pwzDelDriverCommand = L\%lsRunDll32.exe\ 
PrintUI.dll,PrintUIEntry
/dd /m \%ls\ /q /Gw;


Snippet of deferred CA code that uses the above commands.  While this is
working the driver is not in the driver store and I have yet to work on a
DifxApi solution.  There is other refactoring that I am in the process of
doing to extension project.
switch (iOperation)
{
case WCA_TODO_INSTALL:
case WCA_TODO_REINSTALL:
fDoQuietExec = true;
hr = RegOpen(HKEY_LOCAL_MACHINE, pwzPrinterKey, 
KEY_QUERY_VALUE,
hkPrinter);
if (ERROR_SUCCESS == hr) {
/*If the printer exsts, skip calling the 
'install' command on PrintUI
api to avoid creating another printer*/
WcaLog(LOGMSG_VERBOSE, Printer exists, so skip 
calling install
action.\nPrinter Key: %ls\n, pwzPrinterKey);
fDoQuietExec = false;
break;
}

if (true == fDoQuietExec) {
hr = StrAllocFormatted(pwzCommand, 
pwzAddPrinterCommand, pwzSystemPath,
pwzModel, pwzInfPath, pwzPort, pwzName);
ExitOnFailure(hr, failed to format the command 
to install a printer);

hr = QuietExec(pwzCommand, dwTimeout);
ExitOnFailure1(hr, QuietExec failed to execute 
install command, %ls,
and may have timed out., pwzCommand);
}
break;
case WCA_TODO_UNINSTALL:
//uninstalling so look for printers with names which 
include our printer
name.  Typically 'printer name (Copy 1)'
hr = RegOpen(HKEY_LOCAL_MACHINE, pwzPrintersKey, 
KEY_READ, hkPrinters);
ExitOnFailure1(hr, Failed to open the Windows Printers 
key: %ls, ,
pwzPrintersKey);

for (DWORD dwIndex = 0; /* exit via break below */; 
++dwIndex)
{
ReleaseNullStr(pwzPrinterObject);
hr = RegKeyEnum(hkPrinters, dwIndex, 
pwzPrinterObject);
if (E_NOMOREITEMS == hr)
{
hr = S_OK;
break;
}
ExitOnFailure(hr, Failed to enumerate printer 
objects.);

if (NULL == wcsistr(pwzPrinterObject, pwzName)) 
{
//WcaLog(LOGMSG_VERBOSE, RegKeyEnum 
returned %ls, which is not of any
interest to us.  Look for another printer., pwzPrinterObject);
continue;
}

//create a list of printers with similar name, 
to remove later
hr = WcaWriteStringToCaData(pwzPrinterObject, 
pwzRelatedPrinters);
ExitOnFailure2(hr, failed to add printer ( %ls 
) to the list: %ls,
pwzPrinterObject, pwzId);

cPrinters++;
}

ReleaseNullStr(pwz);
pwz = pwzRelatedPrinters;
while (pwz  *pwz)
{
ReleaseNullStr(pwzPrinterObject);
hr = WcaReadStringFromCaData(pwz, 
pwzPrinterObject);
ExitOnFailure(hr, failed to read related 
printer name from related
printer list.);

//remove this printer
ReleaseNullStr(pwzCommand);
hr = StrAllocFormatted(pwzCommand, 
pwzDelPrinterCommand, pwzSystemPath,
pwzPrinterObject);
ExitOnFailure(hr, failed to format the command 
to remove a printer);

hr = QuietExec(pwzCommand, dwTimeout);
ExitOnFailure1(hr, QuietExec failed to execute 
uninstall printer
command, %ls, and may have timed out., pwzCommand);

// Tick the progress bar along
hr = WcaProgressMessage(COST_RDPPRINTERS, 
FALSE);
ExitOnFailure1(hr, failed to tick progress bar 
for printer instance:
%ls, pwzId);
}


Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-11 Thread Arthur, Christopher
Thx, will give it a try,...

Christopher Arthur


-Ursprüngliche Nachricht-
Von: Phill Hogland [mailto:phogl...@rimage.com]
Gesendet: Dienstag, 11. März 2014 13:37
An: wix-users@lists.sourceforge.net
Betreff: Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE 
instead of LPT1

Here are the PrintUI commands that I use.  I would test your parameters on a 
target machine in a admin CMD box prior to integrating into a msi.
LPWSTR pwzAddPrinterCommand = L\%lsRunDll32.exe\
PrintUI.dll,PrintUIEntry /if /b \%ls\ /f \%ls\ /r %ls /m \%ls\ /u /q /z 
/Gw;
LPWSTR pwzDelPrinterCommand = L\%lsRunDll32.exe\
PrintUI.dll,PrintUIEntry /dl /n \%ls\ /q /Gw;
LPWSTR pwzDelDriverCommand = L\%lsRunDll32.exe\ 
PrintUI.dll,PrintUIEntry /dd /m \%ls\ /q /Gw;


Snippet of deferred CA code that uses the above commands.  While this is 
working the driver is not in the driver store and I have yet to work on a 
DifxApi solution.  There is other refactoring that I am in the process of doing 
to extension project.
switch (iOperation)
{
case WCA_TODO_INSTALL:
case WCA_TODO_REINSTALL:
fDoQuietExec = true;
hr = RegOpen(HKEY_LOCAL_MACHINE, pwzPrinterKey, 
KEY_QUERY_VALUE, hkPrinter);
if (ERROR_SUCCESS == hr) {
/*If the printer exsts, skip calling the 
'install' command on PrintUI api to avoid creating another printer*/
WcaLog(LOGMSG_VERBOSE, Printer exists, so skip 
calling install action.\nPrinter Key: %ls\n, pwzPrinterKey);
fDoQuietExec = false;
break;
}

if (true == fDoQuietExec) {
hr = StrAllocFormatted(pwzCommand, 
pwzAddPrinterCommand, pwzSystemPath, pwzModel, pwzInfPath, pwzPort, pwzName);
ExitOnFailure(hr, failed to format the command 
to install a printer);

hr = QuietExec(pwzCommand, dwTimeout);
ExitOnFailure1(hr, QuietExec failed to execute 
install command, %ls, and may have timed out., pwzCommand);
}
break;
case WCA_TODO_UNINSTALL:
//uninstalling so look for printers with names which 
include our printer name.  Typically 'printer name (Copy 1)'
hr = RegOpen(HKEY_LOCAL_MACHINE, pwzPrintersKey, 
KEY_READ, hkPrinters);
ExitOnFailure1(hr, Failed to open the Windows Printers 
key: %ls, , pwzPrintersKey);

for (DWORD dwIndex = 0; /* exit via break below */; 
++dwIndex)
{
ReleaseNullStr(pwzPrinterObject);
hr = RegKeyEnum(hkPrinters, dwIndex, 
pwzPrinterObject);
if (E_NOMOREITEMS == hr)
{
hr = S_OK;
break;
}
ExitOnFailure(hr, Failed to enumerate printer 
objects.);

if (NULL == wcsistr(pwzPrinterObject, pwzName)) 
{
//WcaLog(LOGMSG_VERBOSE, RegKeyEnum 
returned %ls, which is not of any interest to us.  Look for another printer., 
pwzPrinterObject);
continue;
}

//create a list of printers with similar name, 
to remove later
hr = WcaWriteStringToCaData(pwzPrinterObject, 
pwzRelatedPrinters);
ExitOnFailure2(hr, failed to add printer ( %ls 
) to the list: %ls, pwzPrinterObject, pwzId);

cPrinters++;
}

ReleaseNullStr(pwz);
pwz = pwzRelatedPrinters;
while (pwz  *pwz)
{
ReleaseNullStr(pwzPrinterObject);
hr = WcaReadStringFromCaData(pwz, 
pwzPrinterObject);
ExitOnFailure(hr, failed to read related 
printer name from related printer list.);

//remove this printer
ReleaseNullStr(pwzCommand);
hr = StrAllocFormatted(pwzCommand, 
pwzDelPrinterCommand, pwzSystemPath, pwzPrinterObject);
ExitOnFailure(hr, failed to format the command 
to remove a printer);

hr = QuietExec(pwzCommand, dwTimeout);
ExitOnFailure1(hr, QuietExec failed to execute 
uninstall printer command, %ls, and may have timed out

[WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-10 Thread Arthur, Christopher
Hi,

what's the best way of Installing HP LaserJet 4 with wix ?
I've found no straight forward documentation to achieve my goal.


Sincerly

Christopher Arthur

Wichtiger Hinweis: Diese E-Mail und etwa angeh?ngte Dateien k?nnen vertrauliche 
Informationen enthalten und sind ausschlie?lich f?r den/die Adressaten 
bestimmt. Sollten Sie irrt?mlich diese E-Mail erhalten haben, bitten wir Sie, 
uns dar?ber zu informieren und die E-Mail aus Ihrem System zu l?schen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of LPT1

2014-03-10 Thread Tom Brezinski
I think you will need to write a custom action that uses the AddPrinter api.  
DIFxApp is probably out of the question since you don't have driver files.  HP 
says for that printer with all current versions of Windows to use the drivers 
included with the OS.

See AddPrinter:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183343%28v=vs.85%29.aspx


-Original Message-
From: Arthur, Christopher [mailto:christopher.art...@vaps.de] 
Sent: Monday, March 10, 2014 10:04 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Installing HP LaserJet 4 Printer Driver on FILE instead of 
LPT1

Hi,

what's the best way of Installing HP LaserJet 4 with wix ?
I've found no straight forward documentation to achieve my goal.


Sincerly

Christopher Arthur

Wichtiger Hinweis: Diese E-Mail und etwa angeh?ngte Dateien k?nnen vertrauliche 
Informationen enthalten und sind ausschlie?lich f?r den/die Adressaten 
bestimmt. Sollten Sie irrt?mlich diese E-Mail erhalten haben, bitten wir Sie, 
uns dar?ber zu informieren und die E-Mail aus Ihrem System zu l?schen. Das 
unerlaubte Kopieren und die unbefugte Weitergabe dieser Mail und ihrer Inhalte 
sind nicht gestattet.

Important notice: This email and some of the attached files can contain 
confidential information and are intended solely for the addressee. Should you 
have received this email in error, we ask that you inform us about this and 
delete the email from your system. The illegal copying and unauthorised 
re-distribution of this email and its contents are not permitted.
--
Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users