none
Acquiring higher security privileges RRS feed

  • Question

  • Hi. I am developing a click-once program in .NET (C#) that installs a new printer on the user's PC, creating a new printer port in the process.
    This works perfectly in all the Windows operating systems on which I've tried the program so far, except for Windows 7.
    The problem with Windows 7 is the strict default security setting. In the default setting, the user cannot create a new port via the Add Printer wizard, and this also applies to the program. When the security setting is set to the lowest option, both things work, but I would not like to require from the users of my program to change their security setting in order to use my program.
    Is there perhaps a way that the program can request from the user the privilege to do things like creating a new printer port, or creating a new folder in Program Files (this is also not allowed by Windows 7)?

    Thanks, in advance.
    Friday, February 5, 2010 5:23 PM

All replies

  • Hi, bghh:

         The default security settings for Windows 7 and Windows Server 2008 R2 allow users who are not members of the local Administrators group to install only trustworthy printer drivers, such as those provided with Windows or in digitally signed printer-driver packages. This helps to ensure that users do not install untested or unreliable printer drivers or drivers that have been modified to contain malicious code (malware). However, it means that sometimes users cannot install the appropriate driver for a shared printer, even if the driver has been tested and approved in your environment.
         There're ways to allow users who are not members of the local Administrators group to connect to a print server and install printer drivers that are hosted by the server. You may find the following refs helpful.

         Control Printer Driver Installation Security


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Proposed as answer by SamAgain Monday, February 8, 2010 4:12 AM
    Monday, February 8, 2010 4:12 AM
  • The problem is not only installing the printer. In fact, the driver of the printer that is installed is the MS Publisher Color Printer that is one of the drivers which are part of Windows, so that should not pose a problem.
    A description of what the program does in Windows 7 follows:
    - The program runs RedMon's setup.exe, which is a program that installs a redirected port monitor. This causes a dialog to appear which asks the user if he wants to allow the program to make changes to the computer (I would like my program to do this). The redirected port monitor is installed successfully.
    - Now that the redirected printer port type is created, the program tries to create a new redirected printer port, but fails.

    So the program doesn't even get as far as trying to install the printer.

    I've tried installing PDFCreator on the same machine, and like setup.exe of RedMon, it displays the dialog through which the user gives the program permission to change settings and PDFCreator installs successfully, installing a PDF printer.

    The question is, how do I get my program to do this?
    Monday, February 8, 2010 7:23 AM