Rolling FOG out to US Site
-
@RobTitian16 In my setup I will quick patch a target system between image captures. So if I need to update the unattend.xml between image captures or update the setupcomplete.cmd file I can do that via a post install script. Then the next time we capture the image we integrate the “patches” we’ve been doing in the post install script. It works out pretty well.
-
@george1421 Thanks for the help so far
The SetupComplete.cmd doesn’t seem to be working still - when running it through an elevated command prompt, it says: “the installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor…” -
@RobTitian16 OK wait, you are in the windows realm now? So FOS and linux has done its part !!
So the setup complete file IS making to the target computer now?
If so now you need to work in windows to understand what is not right.
How is the fog client msi getting to the windows box? Is the setup complete batch file referencing the full path to the msi?
-
@george1421 Yep, sorry - I responded at 1am which is really not a good idea as I had no idea where I was or what I was doing.
I realised after your post I didn’t actually have a section that would copy across the FOG client msi to the Windows system. I tried to add a couple of lines that would copy across the FogService.zip from /root/trunk/packages/web/client and then unzip it, but it never worked when run (it always said it couldn’t unzip /ntfs/Windows/Setup/Scripts/FogService.zip [.zip]"
So, I’ve now unzipped the FogService.zip on the FOG server and try to copy across the “Fog Service Installer.msi”. However, this doesn’t appear to be working, either. Perhaps I’ve missed something? Or perhaps there’s an easier way to get the msi across to the target computer?
# Check if the file FOG Service Installer.msi exists in the source folder and then copy it to the destination on the C: drive. if [ -f "/root/trunk/packages/web/client/FogService/Fog Service Installer.msi" ]; then cp "/root/trunk/packages/web/client/FOGService/FOG Service Installer.msi" "/ntfs/Windows/Setup/Scripts/FOG Service Installer.msi"; fi # Check if the file SetupComplete.cmd exists in the source folder and then copy it to the destination on # the C: drive. if [ -f "/images/drivers/Common/SetupComplete.cmd" ]; then cp /images/drivers/Common/SetupComplete.cmd /ntfs/Windows/Setup/Scripts/SetupComplete.cmd; # append the msiexec command to the end of the setupComplete.cmd file echo "msiexec.exe /i "FOG Service Installer.msi" /quiet USETRAY=\"0\" WEBADDRESS=\"${FOGIP}\" " >> /ntfs/Windows/Setup/Scripts/SetupComplete.cmd # just in case we edited the setupcomplete.cmd file in unix lets filter it to make it DOS compatible unix2dos /ntfs/Windows/Setup/Scripts/SetupComplete.cmd fi
-
You don’t need the ; at the end of the cp commands.
In fact, in your current structure you only need the ; after the if brackets because you have then on the same line.
I don’t know (and somewhat doubt) that that’s the issue, but doesn’t hurt to check.
Also, you don’t seem to check the existence of the /ntfs/Windows/Setup/Scripts folder before trying to copy there.
So do something like
if [ ! -d "/ntfs/Windows/Setup/Scripts" ] then mkdir "/ntfs/Windows/Setup/Scripts" fi
Before the other two if statements.
-
@Quazz Thanks - will give this a go and see what happens.
-
@RobTitian16 Thinking about it, Windows might sometimes create a scripts folder instead of a Scripts folder.
So we need to check for both.
#if scripts exists then by default Scripts does not, but if scripts does not exist then it's still possible Scripts doesn't either if [ -d "/ntfs/Windows/Setup/scripts" ] then mv "/ntfs/Windows/Setup/scripts" "/ntfs/Windows/Setup/Scripts" else mkdir "/ntfs/Windows/Setup/Scripts" fi
Since Windows doesn’t care about capitalization, you can safely rename it to a capitalized version. This will be overzealous with the mkdir, triggering in more cases than necessary, but since mkdir can’t do anything if the target exists, I don’t consider this to be problematic.
-
@Quazz Unfortunately it’s still not copying the msi across.
I wonder if it’s because of the quotations and if it doesn’t like them there.I’ve also noticed that with the following line, it doesn’t put “FOG Service Installer.msi” in quotes in the SetupComplete.cmd:
echo "msiexec.exe /i "FOG Service Installer.msi" /quiet USETRAY=\"0\" WEBADDRESS=\"${FOGIP}\" " >> /ntfs/Windows/Setup/Scripts/SetupComplete.cmd
-
@RobTitian16 Try single quotes around the whole thing instead of double quotes
echo 'msiexec.exe /i "FOG Service Installer.msi" /quiet USETRAY=\"0\" WEBADDRESS=\"${FOGIP}\" ' >> /ntfs/Windows/Setup/Scripts/SetupComplete.cmd
As for the transfer thingy, only thing that springs to mind is that the origin file path is incorrect or the file doesn’t exist or something, so check that.
If you can, boot a client in debug mode and try to copy it manually
-
@Quazz I’ve just tried this with the debug mode enabled and I’ve realised the path to the Fog Service msi is incorrect (I’ve been going down a rabbit hole I dug myself).
I need to get the FOGService.msi from the FOG server (/var/www/html/fog/client/FOGService.msi). How would I go about doing this in the SetupComplete.cmd?At the moment I literally have:
echo "msiexec.exe /i "FOG Service Installer.msi" /quiet USETRAY=\"0\" WEBADDRESS=\"${FOGIP}\" " >> /ntfs/Windows/Setup/Scripts/SetupComplete.cmd
Where “FOG Service Installer.msi” is, I need it to be the location mentioned above so it will pull the msi from the server (if that’s possible).
-
@RobTitian16 I don’t see why you’d want to do that from SetupComplete when you can just copy it during the postdownload stage.
You may still need to point to the absolute path the the msi installer on the windows drive, but I’m not sure.
-
@RobTitian16 OK that is where I was just circling back to (in my head). Where did “FOG Service Installer.msi” come from. When I go to
http://<fog_server_ip>/fog/management/index.php?node=client
and download the client I get “FOGService.msi” Me thinks you are tying to install the old FOG client (circa 1.2.0)<edit> now that I read the posts instead of looking at the pictures I see that you came to the same conclusion as I </edit>
-
@RobTitian16 And as for the setupcomplete.cmd, for the msi command you may need to specify the full path to the location of the MSI for msiexe to see.
-
@RobTitian16 You guys must remember. The scripts are running at the Client’s Scope.
Meaning, the check for the msi file is not going to work. Why?
The client (during imaging) does not have the “/root/trunk/packages/web/client/FogService/Fog Service Installer.msi” file on it. That (from what I can tell) is the location for the file as it sits on the Server when you run updates?
You might just simplify this and add the msi directly to the images/postdownloadscripts folder.
From the server run:
cp /var/www/fog/client/FOGService.msi /images/postdownloadscripts/
THe copy line would then switch to:
(Changing _ with spaces of course)
[[_-f ${postdownpath}FOGService.msi_]] && cp ${postdownpath}FOGService.msi "/ntfs/Windows/Setup/Scripts/FOGService.msi"
Then your msiexec command would be:
echo "msiexec.exe /i %windir%\Setup\Scripts\FOGService.msi /quiet USETRAY=\"0\" WEBADDRESS=\"${FOGIP}\" " >> /ntfs/Windows/Setup/Scripts/SetupComplete.cmd
Just my two cents.
-
@Tom-Elliott No fair giving Rob the answer. Shame on you!!
Hint: You learn more from your mistakes than your successes.
-
@george1421 Rob, I know this a bit confusing to setup because FOS runs linux it can only leave things in the right spot for windows to find them when OOBE starts. Once everything is in the right spot windows will go, Oh I know what to do with that and process it.
I think through this whole thread, you never posted the target system OS. That may be important if the setupcomplete.cmd file is never really executed. You can have the setupcomplete.cmd file echo a value into a text file to prove if the batch file is actually running as a debugging step if needed.
-
@Quazz Yeah, I could copy it during the postdownload stage. But how would I do so? /var/www/html/fog/client/FOGService.msi doesn’t in the terminal in debug. I can only go as far as /var/www/ and that’s it (I’m not even sure if that’s on the FOG Server or where it’s looking to be honest…)
-
@RobTitian16 That is why I suggested copying the FOGService.msi to the postdownloadscripts directory.
-
@Tom-Elliott Sorry, for some reason when I posted I didn’t see everyone else’s responses (only Quazz’s).
I’ll give this a go Thanks! -
@RobTitian16 I didn’t even think about not having access client side because I copy files off my NAS by mounting it then copying.
I think Tom’s suggestion is the answer now.