次の方法で共有


Branding Images

Hi, it’s Justin here again. Quite often in my day to day routine, I get asked how we include or embed utilities in to our images (my job revolves around lab design and strategy). It’s a question that really doesn’t have a concrete answer, but I’ll share with you what I do in our images to brand them and also make them easier to use.

First off, we need to address what it is we include in every image. Our standard is to include all of the Sysinternals tools for troubleshooting. In doing this we also launch zoomit when the machine starts and brand the background. For starters, we need to get the Sysinternals Suite – which is pretty straightforward – https://www.sysinternals.com/. At writing, there’s a link on the right labeled “Sysinternals Suite” and from there it takes us to the Sysinternals Suite page, where there’s a download link - Download Sysinternals Suite.

Once we’ve got the suite downloaded, we can extract it on our local machine or a test machine because we’re going to need to generate a .bgi file to our liking (for bginfo to brand the backgrounds). I extract the suite to c:\tools for ease of use, and that’s also where it lives on the machines we build, so only fitting. After extraction, we go ahead and fire up bginfo.exe and click on the button to suppress it from disappearing in 10 seconds:

image

In SMSG Readiness we have a default background we like to brand our machines with, so I have that handy and I copy the .bmp to c:\tools as well (our background is called smsgrbg.bmp):

smsgrbg

After copying the .bmp file, I click on the Background button, choose the Use these settings: radio button, change the Wallpaper Position drop down to stretch and the click on the ellipse to find c:\tools\smsgrbg.bmp. Click OK to apply the background image and it will take us back to the items we also want to include on our background.

Next, I go ahead and delete all of these – first because we won’t use them all, secondly, they’re out of order and thirdly, they use Arial font. I put the cursor in the area, do a CTRL+A to select all of the text and then simply hit delete. Next, I switch the font from Arial to Segoe UI, at which time I get a pop-up that says “No text is selected. Would you like to expand the selection to include all text”. Simply click Yes.

After changing the font face, I go ahead and choose what it is we use…I double click Host Name, Boot Time, Snapshot Time, IP Address, DHCP Server, Logon Domain, User Name, Memory, and finally Free Space.

After selecting the elements, I then delete the words “Host Name:” and center the <Host Name> variable as well as center it and change the size from 12 pt to 18pt. I then put a load of “======” under the host name. I then change the word “Snapshot” to Login and put an extra carriage return between what is now “Login Time:” and “IP Address”. I also put an extra carriage return between “DHCP Server” and “Memory” and between “Memory” and “Login Domain”.

After putting the extra space in before “Login Domain” I then change that to read “Logged In User” and remove “User Name:” from the following line, and delete the extra spaces and lastly add a \ between the two variables – turning the line in to “Logon Domain:    <Logon Domain>\<User Name>” (note: <User Name> usually bumps down a line as seen below).

Finally, with the text, I add one more space between the newly changed “Logged In User:” and Free Space.

One other aesthetic thing I do is click on the Position button and put the text in the upper left corner in lieu of the default in the lower right. Lastly, I click on the Desktops button and change all three drop downs to read “Update this wallpaper” and click OK. My configuration then looks like this:

image

Now I click "Preview” to ensure it does what I want and when I’m happy with the results I go ahead and click File –> Save As and save it as c:\tools\smsgr.bgi.

Now that I’m happy with the background I’ve created and I know the tools exist in c:\tools, I create a few supplementary scripts to help me with the rollout. The first one I create is a registry key that will auto-start zoomit.exe which allows for easier presentation and demonstration skills. Here’s the .reg file for that:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Launch ZoomIt"="c:\\tools\\zoomit.exe /accepteula"

I save that as c:\tools\zoomit.reg

I then create the a similar registry file in order to brand the background on each login:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Update Background"="c:\\tools\\bginfo.exe c:\\tools\\smsgr.bgi /nolicprompt /silent /timer:0"

I save that as c:\tools\bginfo.bgi

Next I create two batch scripts. The first one is due to the fact that the c:\tools directory will originate from a “foreign” location. Windows, rightfully, sees this as a security concern and normally on launch prompts you with a security dialogue:

image 

What my batch script does is actually renames the files from .exe to .exe.bak and then pipes them to the original .exe name. Since they are now originating from the same machine, upon launch, the dialogue is suppressed.

@echo off
setlocal

set in_file=c:\tools\
for /f "tokens=*" %%a in ('dir /b %in_file%*.exe') do call :rename %%a
del *.bak
goto :EOF

:rename
set oldname=%1
set newname=%oldname%.bak
ren %in_file%%oldname% %newname%
type %in_file%%newname% > %in_file%%oldname%

:EOF

I call this batch script c:\tools\fix.bat

Lastly I create a batch script and save it as c:\tools\brand.cmd and it has the following in it:

@echo off
mkdir c:\tools
xcopy *.* c:\tools /C /Q
regedit /s c:\tools\zoomit.reg
regedit /s c:\tools\bginfo.reg
c:\tools\fix.bat
del c:\tools\*.reg
del c:\tools\fix.bat
del c:\tools\brand.cmd

With all of these source files in c:\tools I copy the entire directory to my MDT server and create an application (“application with source files”) called “Branding and Tools”. I tell it to simply call “brand.cmd” as the command line and all of the magic happens upon deployment.

The first thing it does, since it is launched from the MDT task sequence is creates a local c:\tools directory to put all of the branding in. After that it copies all of the files from the MDT server to c:\tools. It then imports the zoomit registry settings (to auto launch zoomit). Following that, it imports the background changes we made earlier. It then runs fix.bat which makes all of the *.exe’s in c:\tools think they’re local, subsequently suppressing the security dialogue and then it cleans up after itself. It deletes the registry files, it deletes the fix.bat script and lastly deletes the secondary copy of brand.cmd (remember the brand.cmd that is actually executing is the one part of the MDT task sequence so there aren’t any locks on the one in c:\tools).

Presto, now each time you deploy a new build you’ve got a system that upon reboot has all of the tools on it and is branded and includes the zoomit presentation tool too!

Enjoy!