Looking at
this MSDN page I think that the correct syntax for the GetDefaultPrinter function should be:
code:
System::Call 'winspool::GetDefaultPrinterA(*t .r0,i ${NSIS_MAX_STRLEN})i.r1'
and you should get a non-zero value at $1 if the function succeeds, along with the printer name at $0. You could try adding ?e at the end to get extended error information (on $2):
code:
System::Call 'winspool::GetDefaultPrinterA(*t .r0, i ${NSIS_MAX_STRLEN})i.r1 ?e'
Pop $2
Also the
SetDefaultPrinter call should like this:
code:
System::Call 'winspool::SetDefaultPrinterA(*t "PrinterName")i.r0'
and I think you would have to experiment a bit with both functions to figure out the format of
PrinterName
Hope this helps ...
CF