Installing Fonts via BigFix

(imported topic written by Chris_from_USC91)

Hi, I am new to posting but try to keep current with the Forums.

I ran across this thread which helps if there is no other way to accomplish what we need, I will just have to log in and drag the files to the %Root%\Fonts folder instead. http://forum.bigfix.com/viewtopic.php?id=711

Is there a way to call for Admin to install the fonts, or should I just take my chances and have the fixlet/task run only while local admin is present?

Any help is much appreciated.

(imported comment written by sthull)

Hi Chris,

The BES Client runs as the system account, so it should have the authority to install fonts on the system. Have you tried to copy the fonts over in a regular fixlet, or do you have an executable to run to install the fonts?

Limiting the action to run only when an admin is logged in does not necessarily give admin authority to the action. You would have to use the RunAsCurrentUser utility to utilize the privileges of the currently logged on user. See the following article for more info on RunAsCurrentUser: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=392

Fight on!

Steve

(imported comment written by Chris_from_USC91)

Sorry I have been sick the last couple days, so my response time is a little slow.

I Made my own custom fixlet from the deployment wizard. Here were my steps, and if you think I should change something, please let me know.

  1. I made a folder named Fonts on the desktop and put the .otf files in that folder.

  2. In the BES Console, I went to the “Wizards” menu and choose “Windows Software Distribution Wizard”.

  3. For the name of the application to deploy, I used “Fonts”, next.

  4. I choose the folder option and browsed to the folder “Fonts” on the desktop, next.

  5. I then unchecked everything but Windows XP and Windows Vista, next, next, next, Finish.

  6. The files in the folder were automatically compressed and shipped to the BES Server and the “Create Task” dialog appeared.

  7. In the actions tab, I modified the Action Script. Removed the line “wait __Download\setup.exe” replace it with 11 lines:

copy __Download\Fonts\Caslon540LTStd-Italic.otf “C:\WINDOWS\Fonts\Caslon540LTStd-Italic.otf”

copy __Download\Fonts\Caslon540LTStd-Roman.otf “C:\WINDOWS\Fonts\Caslon540LTStd-Roman.otf”

copy __Download\Fonts\FrutigerLTStd-Black.otf “C:\WINDOWS\Fonts\FrutigerLTStd-Black.otf”

copy __Download\Fonts\FrutigerLTStd-BlackItalic.otf “C:\WINDOWS\Fonts\FrutigerLTStd-BlackItalic.otf”

copy __Download\Fonts\FrutigerLTStd-Bold.otf “C:\WINDOWS\Fonts\FrutigerLTStd-Bold.otf”

copy __Download\Fonts\FrutigerLTStd-BoldItalic.otf “C:\WINDOWS\Fonts\FrutigerLTStd-BoldItalic.otf”

copy __Download\Fonts\FrutigerLTStd-Italic.otf “C:\WINDOWS\Fonts\FrutigerLTStd-Italic.otf”

copy __Download\Fonts\FrutigerLTStd-Light.otf “C:\WINDOWS\Fonts\FrutigerLTStd-Light.otf”

copy __Download\Fonts\FrutigerLTStd-LightItalic.otf “C:\WINDOWS\Fonts\FrutigerLTStd-LightItalic.otf”

copy __Download\Fonts\FrutigerLTStd-Roman.otf “C:\WINDOWS\Fonts\FrutigerLTStd-Roman.otf”

copy __Download\Fonts\FrutigerLTStd-UltraBlack.otf “C:\WINDOWS\Fonts\FrutigerLTStd-UltraBlack.otf”

I made this relevant to all computers.

any suggestions would be phenominal. I am running the latest version of BES 7.2.4.60.

Fight On!

(imported comment written by sthull)

Hi Chris,

It looks pretty good to me. If there is a chance Windows might not be installed on the C: drive, you could replace C:\WINDOWS with {pathname of windows folder}.

Otherwise, I think you’re ready to test it out.

Regards,

Steve

(imported comment written by Chris_from_USC91)

I was off again later that day due to my chest cold getting worse as the day went on.

I actually do the imaging of our machines here along with another Chris, we both work the helpdesk, and we checked. All our machines are a standard C:\ install. I will change the copy path to look like so.

copy __Download\Fonts\Caslon540LTStd-Italic.otf “{pathname of windows folder}\Fonts\Caslon540LTStd-Italic.otf”

I will let you know if it works, otherwise I will just have to copy to a font folder on the C:\ drive and manually install and figure out the rest later.

Thanks for all the help.

(imported comment written by Chris_from_USC91)

extract Fonts.tmp

copy __Download\Caslon540LTStd-Italic.otf “{pathname of windows folder}\Fonts\Caslon540LTStd-Italic.otf”

copy __Download\Caslon540LTStd-Roman.otf “{pathname of windows folder}\Fonts\Caslon540LTStd-Roman.otf”

copy __Download\FrutigerLTStd-Black.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-Black.otf”

copy __Download\FrutigerLTStd-BlackItalic.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-BlackItalic.otf”

copy __Download\FrutigerLTStd-Bold.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-Bold.otf”

copy __Download\FrutigerLTStd-BoldItalic.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-BoldItalic.otf”

copy __Download\FrutigerLTStd-Italic.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-Italic.otf”

copy __Download\FrutigerLTStd-Light.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-Light.otf”

copy __Download\FrutigerLTStd-LightItalic.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-LightItalic.otf”

copy __Download\FrutigerLTStd-Roman.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-Roman.otf”

copy __Download\FrutigerLTStd-UltraBlack.otf “{pathname of windows folder}\Fonts\FrutigerLTStd-UltraBlack.otf”

So I found out that extracting removes the containing folder. I had to remove \Fonts from the copy dialouge. I thought I would post this so someone else doesn’t run into the same problem, thanks for all the help.=)

I am working on a relevance for this task that I will post when I have it working so it will be available for someone else to cut and paste to use.

I have it run as an action that the user needs to accept. This way they can see that if the fonts do not show up they will need to restart the machine to get them to populate, although none of my users have needed to restart to use the fonts.

(imported comment written by sthull)

Thanks for following up, Chris. Here’s some possible relevance that you could use for your task to identify if one of the files is missing:

q: number of files (“Caslon540LTStd-Italic.otf”; “Caslon540LTStd-Roman.otf”; “FrutigerLTStd-Black.otf”; “FrutigerLTStd-BlackItalic.otf”; “FrutigerLTStd-Bold.otf”; “FrutigerLTStd-BoldItalic.otf”; “FrutigerLTStd-Italic.otf”; “FrutigerLTStd-Light.otf”; “FrutigerLTStd-LightItalic.otf”; “FrutigerLTStd-Roman.otf”; “FrutigerLTStd-UltraBlack.otf”) of folder “Fonts” of windows folder < 11

Note that it will return true if any one of the font files is missing, although your action would fail if one of the files already exists because the copy command requires that the destination file does not exist. If you only want it to be true when none of the fonts exist, change the relevance to:

q: number of files (“Caslon540LTStd-Italic.otf”; “Caslon540LTStd-Roman.otf”; “FrutigerLTStd-Black.otf”; “FrutigerLTStd-BlackItalic.otf”; “FrutigerLTStd-Bold.otf”; “FrutigerLTStd-BoldItalic.otf”; “FrutigerLTStd-Italic.otf”; “FrutigerLTStd-Light.otf”; “FrutigerLTStd-LightItalic.otf”; “FrutigerLTStd-Roman.otf”; “FrutigerLTStd-UltraBlack.otf”) of folder “Fonts” of windows folder = 0

You can also add checks in the action script to only copy the file if it doesn’t exist or to try and delete the destination files before copying them in.

Regards,

Steve

(imported comment written by user-removed00191)

Hi,

In a way I think I understand how BES Client run as system account work. But I still fail to do the simple task like copy font to Windows folder. Since all our machine come default OEM so Windows folder is default to C:\Windows. Below are my relevance and also the action. I deploy only on Windows XP since currently I’m not sure where Vista and Windows 7 put the location of fonts.

Relevance:

(name of it = “WinXP”) of operating system AND (not exists file “C:\WINDOWS\Fonts\LSANS.TTF”)

Action:

copy __Download\LSANS.TTF" “c:\windows\fonts\LSANS.TTF”

Not sure why but the action fail. Suspecting it fail due to lack of permission. Any advise anyone?

(imported comment written by SystemAdmin)

Not sure if you copied and pasted that, but you are missing a " before __Download. The System account should absolutely have access to that folder.

(imported comment written by jessewk)

You also have an extra quote in there. Also, if you want to reliably locate the windows folder, use the windows folder inspector:

(name of it = “WinXP”) of operating system AND (not exists file “LSANS.TTF” of folder “Fonts” of windows folder)

copy __Download\LSANS.TTF “{pathname of windows folder & “fonts\LSANS.TTF”}”

(imported comment written by sjsueztech)

Greetings Eveyrone,

I was able to get my fonts installed, finally, with no issues. Originally I had a VM over NAT, so I am thinking that was causing issues. Now I am trying to remove them, since the fonts we are using have been developed by our organization and must be used only in certain scenarios. Thus, I needed to write a fixlet to remove them, just in case that is required. Below is the code I am using along with results:

if {exist file "C:\Windows\\Fonts\<fontfilename>"}
dos del "{pathname of windows folder}\Fonts\<fontfilename>"
elseif {exist file "C:\Windows\\Fonts\<fontfilename>"}
dos del "{pathname of windows folder}\Fonts\<fontfilename>"
else {exist file "C:\Windows\Fonts\<fontfilename>"}
dos del "{pathname of windows folder}\Fonts\<fontfilename>"
endif

I may be able to use a loop for this, but I don’t know how to do that yet.

I double-checked the action script using fixlet debugger in the “Actions” tab. It runs successfully and actually removes the font I specify. Although, when I actually deploy this fixlet, everything runs completely, but doesn’t actually remove the fonts. I set the criteria as follows:

Success Criteria

This action will be considered successful when it runs to completion.

Relevance Check is as follows:

(exist files("";"") of folder “Fonts” of Windows Folder)

I have a lot more fonts we are using, but I only show 2 for post readability.

I checked the “Show Action Info” by right-clicking the computer name and all the action script code executes completely, but when I use a command prompt to find the fonts the fixlet is suppose to delete, I can see all of the fonts.

If I set a custom success criteria where the relevance check written above is checked to be false, the fixlet stays in the “Waiting” state even though all of the action script executed completely.

I also tried using the following code, but no luck, it actually fails on the first line. I tried tweaking it, but still no go:

if {exist file “C:\Windows\Fonts<fontfilename>”}
delete "C:\Windows\Fonts<fontfilename>"
elseif {exist file “C:\Windows\Fonts<fontfilename>”}
delete "C:\Windows\Fonts<fontfilename>"
else {exist file “C:\Windows\Fonts<fontfilename>”}
delete "C:\Windows\Fonts<fontfilename>"
endif

It is weird that I can run the command using fixlet debugger manually on one of the fonts and it works, but even though each line of code completes, the fonts are NOT deleted using the fixlet. I know I am probably missing something.

I failed to mention that, it looks like the relevance language is working, since the fixlet state is staying in a “waiting” state, since the fonts are not actually deleted.

Any ideas?