Jump to content

Recommended Posts

Posted

Is there a way to allow staff to install fonts without admin rights?

 

Or, more correctly, is there a standard/simple way to allow staff to install fonts without admin rights?

Posted (edited)

Looks like a solution to this will be:

 

Create a folder in their H drive called Fonts.

Have an application/ps script that runs on login which iterates through those fonts and registers them.

Add an icon to the desktop which they can click to run the application there and then, rather than logging out and in when they add a new font.

 

However, it all depends on the time it takes to process such a thing.

 

The details at that site @SovietRussia posted don't work. It still prompts for UAC.

Edited by localzuk
Posted

We had a look at this at the end of the holidays once we'd finished our jobs list (I know!) and kept hitting brick walls after every stage. At the moment we get users to email us fonts and we push them out via GPP (file & reg entry) but that's a faff, slow, and usually overkill as it's often just one PC that needs the font for one student, not every machine on site.

 

So if you do get that script working, post it up so I can have a crack with it as well :)

Posted

Possible script:

 

"Paste the following code in notepad and save it as "ADD_Fonts.cmd"

place the cmd file inside the folder of the fonts you want to install and run it or

add the source folder as a parameter. for example "ADD_fonts.cmd" C:\Folder 1\Folder 2\"

 

 @echo OFF
TITLE Adding Fonts..
REM Filename: ADD_Fonts.cmd
REM Script to ADD TrueType and OpenType Fonts for Windows
REM By Islam Adel
REM 2012-01-16


REM How to use:
REM Place the batch file inside the folder of the font files OR:
REM Optional Add source folder as parameter with ending backslash and dont use quotes, spaces are allowed
REM example "ADD_fonts.cmd" C:\Folder 1\Folder 2\


IF NOT "%*"=="" SET SRC=%*
ECHO.
ECHO Adding Fonts..
ECHO.
FOR /F %%i in ('dir /b "%SRC%*.*tf"') DO CALL :FONT %%i
REM OPTIONAL REBOOT
REM shutdown -r -f -t 10 -c "Reboot required for Fonts installation"
ECHO.
ECHO Done!
PAUSE
EXIT


:FONT
ECHO.
REM ECHO FILE=%~f1
SET FFILE=%~n1%~x1
SET FNAME=%~n1
SET FNAME=%FNAME:-= %
IF "%~x1"==".otf" SET FTYPE=(OpenType)
IF "%~x1"==".ttf" SET FTYPE=(TrueType)


ECHO FILE=%FFILE%
ECHO NAME=%FNAME%
ECHO TYPE=%FTYPE%


COPY /Y "%SRC%%~n1%~x1" "%SystemRoot%\Fonts\"
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%FNAME% %FTYPE%" /t REG_SZ /d "%FFILE%" /f
GOTO :EOF

Posted
Hmm have an idea but not sure if it works but worth a try? @localzuk I think you use SCCM right? Can you create a package to install a font and advertise it for users to install? I *think* it will run under the right context to install without UAC?
Posted
Can you create a package to install a font and advertise it for users to install? I *think* it will run under the right context to install without UAC?

Yeah. That should work. Create an 'Application' for fontreg, place all of the fonts in the same folder and then deploy. Simples! :)

Posted

Well FWIW you can do it with Group Policy Preferences by copying the file to C:\Windows\Fonts and creating a registry key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts (REG_SZ, Value Name=font name to display, Value Data=filename).

 

Our problem is that this involves us and is time consuming for us and the user, who must restart their PC. I had hoped to just let them drag & drop into the Fonts folder but permissions don't allow, so a script they can run to trigger the install would gbe the next most convenient method.

 

I don't know if OP is after a solution for the same reasons I am, if it's just about installing fonts then GPP is the least effort to set up (and the easiest to add to - no repackaging or creating new MSIs every time one new font is added) but it's still not the most convenient.

Posted

Problem is the regularity with which staff want new fonts installing. Ie. Its constant.

 

So, I'm using the following script.

 

$FONTS = 0x14$Path="c:\rWindows\temp\fonts"
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
New-Item $Path -type directory
Copy-Item "\\storage\public\fonts\*.ttf" $Path
$Fontdir = dir $Path
foreach($File in $Fontdir) {
 $objFolder.CopyHere($File.fullname)
}
remove-item $Path -recurse

 

That way, they just stick .ttf files in a folder and away they go.

Posted
Where do they keep getting all the new fonts from? I don't think I have installed an extra font in years? I assume they are all correctly licenses or open source fonts and not pirate?
Posted

Sites such as DaFont. Staff are aware they can only use ones marked as Free and not Free for personal use.

 

I'm not having much luck with the script at the moment... It copies the file over but doesn't do the install. I'll keep playing.

Posted

Ready for a genius, easy to deploy, although convoluted way?

 

Note that this only deals with needing to elevate, not with the install itself...

 

1.Make a service account which has the local admin rights (add it to the local admin group using gpp if need be) -optional

2. Deploy a scheduled task (through gpp) that runs as the service account. Due to security mappings, you will not be able to deploy a gpp scheduled task with a local account such as system. The task, which runs with highest rights, executes your script which does xxxxxxxx.

3. Sit back and enjoy the awesomeness. All they have to do is trigger the task when they want to install new fonts.

 

Yes, you can use this method to do anything.... for me, the hardest part was getting people to go to task scheduler and hit run if they wanted some software installed, but they soon learn.

  • 2 years later...
Posted (edited)
I'm not having much luck with the script at the moment...

There are a few errors in your script. Try this instead...

 

$Source      = "\\Storage\Public\Fonts\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder  = "C:\Windows\Temp\Fonts"

New-Item $TempFolder -Type Directory -Force | Out-Null

Get-ChildItem -Path $Source -Include '*.ttf','*.ttc','*.otf' -Recurse | ForEach {
   If (-not(Test-Path "C:\Windows\Fonts\$($_.Name)")) {

       $Font = "$TempFolder\$($_.Name)"
       
       # Copy font to local temporary folder
       Copy-Item $($_.FullName) -Destination $TempFolder
       
       # Install font
       $Destination.CopyHere($Font,0x10)

       # Delete temporary copy of font
       Remove-Item $Font -Force
   }
}

 

Note. Make sure you leave \* on the end of the $Source path.

Edited by Arthur
Posted
I just used Advanced Installer free version to create an MSI that installed all the fonts people wanted.

After posting above I needed to deploy some fonts and did just that and deployed via sccm. Works great.

 

AI has the ability to create the msi so it registers the font.

  • 1 year later...
Posted
I am working in an environment with very tight IT securities. As a web designer, I need frequent access to installing fonts which has become impossible with constantly needing admins to do it for me. Could you provide a more detailed set of steps on how to get this script working? I have very little programming knowledge.

 

If it is a very tight security environment I doubt you will be able to run a random script. You'd be better off looking at implementing web fonts (can't remember the exact term) so you don't need to install the fonts.

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



×
×
  • Create New...