Announcement

Collapse
No announcement yet.

Copying Fonts in Windows Server 2008 R2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copying Fonts in Windows Server 2008 R2

    During the deployment on the target machine, i am not able to copy my custom fonts to the '%FontsFolder%' (Despite running the installer as an administrator). Note that this behavior is only on Windows 2008 R2 Server. This works on Windows 7 and Windows 2012 Server. I tried to copy the fonts manually using 'Shell.Execute(..' and still i cannot see any of my fonts in the "C:\Windows\Fonts" folder.

    Does anybody have any thoughts?

    Thanks,
    James

  • #2
    What does the installation log file tell you? Shell.Execute() does not copy files, btw. and fonts aren't executables.

    Ulrich
    Last edited by Ulrich; 02-04-2014, 07:59 PM.

    Comment


    • #3
      Ulrich,
      Sorry for not including enough details in the original post.

      1)I wasn't using the Shell.Execute to 'open' a font, instead i used the following command
      Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY C:\Program Files (x86)\StoneRiver\Tracker PRO\Fonts\*.TTF C:\Windows\Fonts /Y", "", SW_SHOWNORMAL, true);
      2) The installation log shows 3 entries for my font. They are
      1. "Success Install archive file:" <full source path of font>
      2. "Success Register font: TFG Bar Code (TrueType), <full source path of font>
      3. "Success File added to uninstall list: <full source path of font>
      3) I also have the standard file copy defined in Setup Factory, which did not work and hence attempted item# 1. (Find the screen shot below)


      But after the installation, the font is just not there (Not present in the fonts folder and the application cannot find it either)

      Thanks,
      James
      Last edited by James.Poulose; 02-05-2014, 09:20 AM. Reason: Added screen shot link

      Comment


      • #4
        1)I wasn't using the Shell.Execute to 'open' a font, instead i used the following command
        Code:
        Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY C:\Program Files (x86)\StoneRiver\Tracker PRO\Fonts\*.TTF C:\Windows\Fonts /Y", "", SW_SHOWNORMAL, true);
        I see a few issues here:
        • Shell.Execute() spawns a new process and does not inherit the current access rights. This means that you will be running cmd.exe at user level, not admin. The user does not have the required rights to write into the FontFolder.

        • There are multiple backslashes missing from the command, which will not perform properly as it is written now. It should be more like this:
          Code:
          Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY C:\[HIGHLIGHT]\[/HIGHLIGHT]Program Files (x86)\[HIGHLIGHT]\[/HIGHLIGHT]StoneRiver\[HIGHLIGHT]\[/HIGHLIGHT]Tracker PRO\[HIGHLIGHT]\[/HIGHLIGHT]Fonts\[HIGHLIGHT]\[/HIGHLIGHT]*.TTF C:\[HIGHLIGHT]\[/HIGHLIGHT]Windows\[HIGHLIGHT]\[/HIGHLIGHT]Fonts /Y", "", SW_SHOWNORMAL, true);
        • You need to place quotes around arguments which contain spaces.
          Code:
          Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY [HIGHLIGHT]\"[/HIGHLIGHT]C:\\Program Files (x86)\\StoneRiver\\Tracker PRO\\Fonts\\*.TTF[HIGHLIGHT]\"[/HIGHLIGHT] [HIGHLIGHT]\"[/HIGHLIGHT]C:\\Windows\\Fonts[HIGHLIGHT]\"[/HIGHLIGHT] /Y", "", SW_SHOWNORMAL, true);
        • You do better not using hard coded paths at all. Instead, use the available Session Variables, or call Shell.GetFolder() to retrieve the paths you need.

        • For the reason explained in item 1, you should use File.Run() instead if you want to execute this command, as File.Run() would run the command with the same admin privileges as the parent process.

        • If you perform the TTF file copy manually to the fonts folder, you may also need to register the font manually, using System.RegisterFont(). And this means you would also need to unregister the font manually upon uninstall, and delete the file manully, as Setup Factory does not undo any actions you performed via script.


        2) The installation log shows 3 entries for my font. They are
        1. "Success Install archive file:" <full source path of font>
        2. "Success Register font: TFG Bar Code (TrueType), <full source path of font>
        3. "Success File added to uninstall list: <full source path of font>
        This would mean that the file was indeed deployed. Have you checked, using a DOS command window, if the files appear when you perform a DIR command? In the Control Panel, fonts may be hidden when they are not suitable to the current settings - for example the "Hide fonts based on language settings" may be enabled.

        3) I also have the standard file copy defined in Setup Factory, which did not work and hence attempted item# 1. (Find the screen shot below)
        What was the error message and/or code you received? What happens if you install the font manually - is there something (an external application, system restore, etc.) removing the font afterwards?

        Also, I saw this, you could see if it makes a difference applying this hotfix.

        Ulrich
        Last edited by Ulrich; 02-05-2014, 12:33 PM. Reason: more info added

        Comment

        Working...
        X