We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Fluxtor
Posts: 17
Joined: Thu Apr 09, 2015 3:33 pm

Creating a Printer Installer that also Adds the printer

Hi,

Firstly apologies for my lack of knowledge but I am new to MSI building and authoring.

We are trying to develop a product that requires a custom XPS printer driver and printer installing. We can perform all of the necessary steps manually but would like to package them into a MSI installer for release to our clients.

We've manged to create an installer that will install the driver using DIFxApp but would like the installer to also add a printer that uses the driver we've just installed. The printer is not a physical printer so does not need to be connected but is a printer that uses Mirosofts XPS driver framework.

Could anyone give me some pointers on how to configure the installer to add a printer or point me in the direction of documentation that explains how to do this. We have experimented with rundll printui.dll,PrintUIEntry.dll within a command shell so maybe there is a way to add this to the installer?

We are currently running an evaluation version of Advanced Installer but could we create such a project (if possible) within the free version or would we need to purchace a licenced version and if so what would be the minimum version required?

Thanks in advance!
Fluxtor (Trevor Dale)
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Creating a Printer Installer that also Adds the printer

Hi Dale and welcome to Advanced Installer forums,
We have experimented with rundll printui.dll,PrintUIEntry.dll within a command shell so maybe there is a way to add this to the installer?
If you managed to install manually the related printer through a command line, then you can use the same approach through a custom action. For example, you can use the predefined Launch file custom action.
We are trying to develop a product that requires a custom XPS printer driver and printer installing. We can perform all of the necessary steps manually but would like to package them into a MSI installer for release to our clients.
Can you please give us more details about the steps that you are doing in order to install manually the printer so I can have a better view about this? Based on the provided details, I can guide you to create the installation package.
We are currently running an evaluation version of Advanced Installer but could we create such a project (if possible) within the free version or would we need to purchace a licenced version and if so what would be the minimum version required?
During the trial you have access to all the features, without any limits. The setup packages will just include message boxes during the installation, saying they were built with a trial version of Advanced Installer. Other then that, you can change dialog backgrounds, branding, anything you want.

Just make sure you create the project type you need, as the features are limited based on the project type.

Since you are already using the Driver feature, then you need at least the Enterprise edition of Advanced Installer.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fluxtor
Posts: 17
Joined: Thu Apr 09, 2015 3:33 pm

Re: Creating a Printer Installer that also Adds the printer

Hi Dan,

Thanks for the speedy reply.

With regards to the printer driver we have created a custom .inf file style driver using MS sample xps driver (Windows WDK).

Manual installation steps would be using the Add printer wizard and pointing at the .inf file.

So far we've created an msi which will install the driver by way of using a merge module taken from MS DIFxApp included in the Windows Driver Kit. A bit of manual editing of the MSI using MS Orca.

The steps taken I found elsewhere by googling like below:

1.Author a new MSI package in Advanced Installer to install the extracted files to a directory in Program Files.
2.Open the built MSI in Orca.
3.Go to Tools > Merge Module.
4.Import the platform-appropriate DIFxApp merge module from the directory created earlier by the DIFxApp installer:

x86: x86\difxapp.msm
x64: amd86\difxapp.msm

5.Accept any Merge Conflict errors in the _Validation table.
6.In the File table, find the row containing the driver's .inf file and copy the value from the Component_ column.
7.In the MsiDriverPackages table, add a new row. Paste the copied value from the File table into the Component field. Sequence can be left blank.

If you are installing only drivers in this MSI, you can set Flags to 4 to avoid having two different entries in Add/Remove Programs. If installing as part of another software
package, set to 0. Also see special functionality as described in the schema.

8.Save the MSI.

Hope this helps, if you need more information please let me know.
Trev
Fluxtor
Posts: 17
Joined: Thu Apr 09, 2015 3:33 pm

Re: Creating a Printer Installer that also Adds the printer

Hi,

I wanted to follow up on this post as we have made some progress, if not very small steps. Firstly we love this product and have since purchased a professional license.

We have now changed our approach to installing our printer and driver based on earlier comments. We are now copying the driver files (*.inf, *.cat and all required files) to the target machine and installing the printer and driver by using a batch file utilising "rundll32 printui.dll,PrintUIEntry". We have successfully managed to get this to work by using the Custom Action "LaunchFile" to run the batch file but would like to optimise as much as possible the cleanup process as this is just the initial stage of the installation package we are trying to create.

We are a little confused the with sequencing of events and the correct point to add the LaunchFile. We can get the process to complete by copying all of the files to the target machine (including the batch file) and calling the LaunchFile after the "Finish Execution" stage. Whilst this works we would like to copy the files over as temporary files so they clean up after the installation has completed. When using this approach we cannot get the installation to complete without error.

Our method/steps (loosely).

1> Copy the driver files to the target machine. These files are added via files and folders and are installed on the target machine.
2> Use LaunchFile to fire our batchfile which will install the driver and add the printer. The batch file is added as a temporary file via files and folders.

No matter where we insert the LaunchFile action the installer never completes without error. When the batch file is added as a temporary file it either gets launced before the required files have been copied to the target machine (the driver files in step 1 above) or the file itself (the batch file in step 2 above) is cleaned up before it can be launched.

Is it possible to achieve what we are trying to do by using temporary files? Any pointers or help would be greatly appreciated.

Thanks in advance!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Creating a Printer Installer that also Adds the printer

Hello,

We apologize for our delayed reply, but we were quite busy lately.

To successfully launch your temporary BAT file using a "Launch file" custom action you should schedule your custom action after "Install Execution Stage -> Add resources" action group and you should enable its "When the system is being modified (deferred)" execution time option.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fluxtor
Posts: 17
Joined: Thu Apr 09, 2015 3:33 pm

Re: Creating a Printer Installer that also Adds the printer

Hi Daniel,

Thanks for taking the time to answer. This worked a treat.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Creating a Printer Installer that also Adds the printer

You're welcome. I'm glad you got everything working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Larry
Posts: 1
Joined: Tue May 23, 2017 2:58 pm

Re: Creating a Printer Installer that also Adds the printer

Hi Dan,

That would be great if you could supply a installation steps to create a MSI package and driver/printer installation.

Cheers
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Creating a Printer Installer that also Adds the printer

Hello and welcome to our forums,

Please follow our "Installing Driver" article steps and see if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”