Sign in to follow this  
Followers 0
jberisford

Deploying Fonts to PC's without admin rights

2 posts in this topic

Well as my wonderful luck is, I've been tasked with ANOTHER script to write, and again - I CANNOT get it to work.

My task this time is to install fonts on end-user computers(i.e. users without Admin rights), similar to another post on here. However, I have 6 to install, but I think if I could get 1 to work I could get the rest.

My problem is that I cannot get it to work consistently. On 1 PC, it'll work, on another it behaves completely different - such as installing, only 0k in size. On another, it doesn't even install them, despite the event log saying that it runs. I also know that it runs because I throw in a little registry ticker saying it installed, so I know it at least executes.

I am trying to call an MSI file which installs the fonts as a package, AND I'm doing it manually by copying the file and using the DllCall('gdi32') trick that I found in another post.

Regardless of my method - I seem to be consistently unsuccessful.

Has anyone actually written a working script that does what I am trying to do?

Below, I've posted the scripts. (FONTS.EXE calls FONTS2.EXE under admin context)

FONTS.EXE

$fonts = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Christian & Timbers", "Marketing Fonts")

if $fonts = 1 then

exit

endif

RunAsSet("svc_appinstall", "ctnet", "eat@joes!!!", 0)

RunWait("fonts2.exe")

RunAsSet()

exit

FONTS2.EXE

(this runs an MSI AND attempts to manually install the fonts, they both do the same thing, but neither really work)

RunWait ("msiexec /i \\cle01chrtmbf01b\share\public\fonts\fonts.msi /quiet")

FileInstall ("c:\fonts\AvenirLTStd-Roman.otf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\GRGBD___.ttf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\GRGBL___.ttf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\GRGLT___.ttf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\MinionPro-Bold.otf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\MinionPro-BoldIt.otf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\MinionPro-It.otf", "c:\windows\fonts\", 1)

FileInstall ("c:\fonts\MinionPro-Regular.otf", "c:\windows\fonts\", 1)

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\AvenirLTStd-Roman.otf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\GRGBD___.ttf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = @WindowsDir & '\fonts\GRGBL___.ttf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\GRGLT___.ttf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\MinionPro-Bold.otf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\MinionPro-BoldIt.otf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

FileDelete($sFileName)

EndIf

$sFileName = ""

$sFileName = @WindowsDir & '\fonts\MinionPro-It.otf'

$a = DllCall('gdi32','long',"RemoveFontResourceA",'String',$sFilename)

If not @error and $a[0] <> 0 Then

Share this post


Link to post
Share on other sites



Please pardon my irreverance. But you are not using AutoIt. Just make a script that opens up the Fonts folder, say Install Fonts under Files and write in the location in the dialog box. Windows will handle the registry for you. AutoIt handles Windows. (note: may be OS dependant)

PS: The problem may be exacerbated by Font Managers, such as one app installed by default with some Adobe progs.

J


If I am too verbose, just say so. You don't need to run on and on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0