Page 1 of 1
How do you create a port?
Posted: Wed Jul 07, 2010 3:21 pm
by bokkie
Guys, I feel somewhat ashamed to be asking what is a trivial question but how do I create a local port on a machine? I need to create a NUL port for the installation of a printer driver which will follow. I'll check the registry at work tomorrow just in case it's done like that? I did a quick scan through the IA designer but I can't see an obvious reference to creatting a port. If somebody could give me a gentle nudge in the right direction I'll research it in the morning.
Thanks. Peter.
Re: How do you create a port?
Posted: Mon Jul 12, 2010 1:59 pm
by mills
One way to go about this would be to create a DLL with the functionality to create the printer port. See MSDN for example:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
And another example with similar code:
http://www.winvistatips.com/adding-prin ... 89100.html
Once you have a DLL that can create the printer port, you can call the DLL from InstallAware using the MSIcode "Call DLL Function".
If this doesn't help, you might want to clarify what exactly you're trying to accomplish and what edition of IA you're using (Express/Developer/Studio).
Re: How do you create a port?
Posted: Tue Jul 13, 2010 1:19 am
by bokkie
Andy,
I've created a printer device that writes the file you are printing as tif/jpg files onto the hdd. Everything works installed manually so now I've got to package the puppy. Because there's no physical port I need to create "nul" if it does not exist. After that I can run the printer's .inf file to register the printer and then I can copy the .gpd file to set the printer's initial default properties. I can probably create the "nul" port directly by copying what I have in my registry. So, there's many ways to do it. I'd prefer to avoid writing a callable DLL to do it as it introduces a level of arcane magic that is better left in the open where others can see it!
I'm using Studio.
Re: How do you create a port?
Posted: Tue Jul 13, 2010 9:05 pm
by mills
Have you tried using the DIFx driver install plugin command? You can get an overview of it by typing "difx" in IA's help index.