Jump to content

Recommended Posts

Posted

Using these instructions: Use Group Policy Software Installation to deploy the 2007 Office system

 

I can't get the script to run at windows startup on my Windows 7 PRO. If I run the script directly on the machine it fails and errors (error code 1) and puts a log entry in the officelogfiles. I'm assuming the script fails as it was designed to run at startup. I may have to work on the script to make the install work but my issue for the moment is that it doesn't appear that windows runs the script at all during startup as the program isn't installed and no error is recorded in the officelogsfiles.

 

I also can't find an event entry stating whats going on?

 

setlocal

REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************

REM Get ProductName from the Office product's core Setup.xml file, and then add "office14." as a prefix. 
set ProductName=Office14.PROPLUS

REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer="\\spserver\distribution point\office2010"

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile="\\spserver\distribution point\office2010\ProPlus.WW\config.xml"

REM Set LogLocation to a central directory to collect log files.
set LogLocation="\\spserver\distribution point\office2010\officelogfiles"

REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************

IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
:ARP64
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if NOT %errorlevel%==1 (goto End)

REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a 64bit OS) 
:ARP86
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto End)

REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End

Endlocal

Posted (edited)

Unless I'm missing something, It's working as it's asked to :( It's only told to post an error log when it works, because :End as such has no logging in it....

 

REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End

 

As above, If product not found (aka it needs to install), Run install + Log

If found or "other error" Do nothing.

 

Simple way to test it, is add an:

 

echo %date% %time% Script went to End!!! >> %LogLocation%\%computername%.txt

 

into this part so it's like:

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End
echo %date% %time% Script went to End!!! >> %LogLocation%\%computername%.txt

 

Rerun it, and see if its running the script just failing somewhere else, or what. If the line is printed it's failing on one of the earlier checks, but currently you have no way of knowing if it runs and just errors/found product, or if it's not running at all.

 

 

*Edit - As a stupid question, what filetype did you save this "script" as?

 

Steve

Edited by Steve21
Posted
the script was saved as a BAT file, but just for testing I also tried cmd. As I know the script fails as office is not installed, so I'm expecting an error. I've told the script to run interactivley and with the logo but this does not happen. I added the script into the group policy. view file drag and drop. blah blah. I also tried pointing to the script directly from the distribution point. All my msi's install from my distribution point but perhaps I need different security settings on the share to allow the machine only to access the script?
Posted

As I know the script fails as office is not installed, so I'm expecting an error

 

(Not sure if I'm misunderstanding what you're thinking, or if you're getting the logic backwards)

 

It's checking if there's an uninstall regkey (aka installed), and if it is installed it'll break out. No error logged (in your version). Just goes straight to :End.

If it's not installed, it should run into the install. If it errors on install, it'll return the log message.

 

aka, If as you mentioned it's not putting any error in log files, or installing program, it may well not be failing, just going to End as it thinks it's installed. Kind of hard to know without adding the debug line I mentioned above. If you add that to the BAT, and restart the pc it should add "something" to the log file, either that it went to End, or your normal debug line. If neither add we'll see from there.

 

Sorry if that makes little sense, (Waffled :D)

Steve

Posted

ok, i added that line to the end of the script (but before the endlocal) reset the vm and nothing, no log file.

 

how do i find out what windows 7 is doing when it runs (or does not run) this script.

Posted

what happens if you run it manually?

 

might be worth trying that and adding lots of pause statements see if you can see where its escaping

  • Thanks 1
Posted (edited)

OK. I get "27/09/2011 15:08:24.89 Setup ended with error code 1." in the log file. foo

 

I wrapped quotes around the distribution point path because of the spaces. It doesn't like the spaces. I've move the source files and redone the script. Still testing.

Edited by chazzy2501
Posted (edited)

OK, the script really doesn't want spaces. I've move the source files & redone the script. If I run the script now it prompts UAC. I deny it and I get the error code 5. This is great as I've now fixed the script but can still not get it to run automatically.

 

EDIT: OK the script runs! It installed office hoorah! Now office is asking for activation :( I did use the autoactivation command maybe I missed something? anyhow using VAMT 2.0 should be ok.

Edited by chazzy2501
  • 3 months later...
Posted

Did you manage to get the installation to automate as a startup script?

 

Did you experience the issue of the installation running in the background and letting users log on before the installation had finished?

Posted
Yes, it does let my users login before it finishes. Its a small issue though, I've decided to not have it activate automatically that way I can keep track of them through VAMT.
Posted

Ok.

 

There is a switch that you can do apparently, you do a start /wait \\server\share\setup.exe /adminfile \\server\share\config.mst.

 

But i can't get it to wait. It just does the same.

Posted
Did you manage to get the installation to automate as a startup script?

 

Did you experience the issue of the installation running in the background and letting users log on before the installation had finished?

 

Also note if uninstalling Office 2007 it does a reboot halfway through unless you add an extra suppress switch in the customisation wizard...

 

Even when testing with SCCM it's not foolproof at stopping users running Office before \ during the installation... can't understand why the deployment methods don't have some way of locking a PC to users when installing major suites like Office...

Posted
Also note if uninstalling Office 2007 it does a reboot halfway through unless you add an extra suppress switch in the customisation wizard...

 

Even when testing with SCCM it's not foolproof at stopping users running Office before \ during the installation... can't understand why the deployment methods don't have some way of locking a PC to users when installing major suites like Office...

I cant understand why they changed methods from office 2003 which was great for deployment to the pita thats 07/10

  • Thanks 1

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...