How do you create a port?

Got a problem you cannot solve? Try here.
Post Reply
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

How do you create a port?

Post 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.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: How do you create a port?

Post 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).
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: How do you create a port?

Post 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.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: How do you create a port?

Post 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.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Post Reply