AutoSPInstallerLaunch fail

May 14, 2011 at 2:26 PM

When I launch this batch file, it elevated the execution policy and run to the last line that started the install. But I got a new window and there is some red error text in it. Then the window was automatically dismissed. There wasn't enough time for me to read the error message before it was gone. Does anybody have the similar problem? I've tried this on multiple machines and it failed every time for me. Yet I've also seen it's working(from a demo)... I've been told that it's a group policy setting, and I went ahead and disabled UAC. But this didn't help.

Can anybody help and tell me what it is? Thanks a lot.

May 16, 2011 at 9:08 PM

I'm getting the same error.  I updated the powershell script to -noexit so it wouldn't exit but there are several errors.  It looks like it is not recognizing the functions.  Has anyone found a solution to this yet?

May 16, 2011 at 9:52 PM

After a reboot, I ran the script again with a new copy of the ps1 files and it ran successfully.  The files must have corrupted at some point.

Coordinator
May 17, 2011 at 2:41 AM

Check if there is a group policy that prevents changing the PowerShell execution policy. Otherwise, check the path (permissions/spaces?) you're running the script from.

HTH,
Brian

May 18, 2011 at 9:45 PM

Thanks for the replies. I found the reason why this was happening, it was becuause my installation folder name has a space in it. Victoronline2, can you tell me where to add -noexit so that I can see the exact red error message? In fact, I've passed the installation phase by manually run the powershell with input file as argument, but the mystic flashing window still bugs me. Also, I'll keep the changing execution policy in mind, cause it might be the reason why it wasn' working in my other environment.

May 19, 2011 at 2:57 PM

I've justed started looking at these 2010 scripts and like the 2007 version want to be able to store/run them centrally.  I ran into the powershell spaces issue as well, what I've done as a workaround for our environment is change the following in the "AutoSPInstallerLaunch.bat", note this is assuming your using the default config file and the spautoinstaller files are in the appropriate directory
….
Set InputFile=.\AutoSPInstallerInput.xml
….
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" -noexit -Command Start-Process "$PSHOME\powershell.exe" -Verb RunAs -ArgumentList "'.\AutoSPInstallerMain.ps1 %InputFile%'"

Hopefully this helps and saves someone sometime

May 19, 2011 at 10:59 PM

I added the -noexit to the argument list in the LAUNCHSCRIPT section.  Of course I removed it once I got a successful install since the point is for it to be unattended.

:LAUNCHSCRIPT"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" -Command Start-Process "$PSHOME\powershell.exe" -Verb RunAs -ArgumentList "'-noexit %~dp0\AutoSPInstallerMain.ps1 %InputFile%'"

Coordinator
May 20, 2011 at 4:45 AM

@Tama - Great idea, can't wait to test this. I struggled with this for a while, I'm encouraged to see such a simple fix!

Cheers
Brian

Coordinator
May 20, 2011 at 5:32 AM

For some reason I could not get @Tama's fix to work. It seemed to always assume C:\Windows\System32 as the working directory.

Note: I am running the AutoSPInstallerLaunch.bat from a UNC path (and almost always run from a UNC path). To me this is more important than trying to work around spaces in the path; it's usually trivial to get rid of spaces in the path, but having to copy the installer files & script to each server in a farm is more of a pain for me.

Brian

May 20, 2011 at 1:23 PM

@brianlala - after I posted I realised the script was running from a mapped drive and didn't work from a UNC path.  So I'm back looking for away to use the scripts from a UNC path, here's one approach thats WIP as it still has issues ie. it doesn't like the ArgumentList wrapped in () and the powershell doesn't open in a separate window;

... :** I set the InputFile variable back as it was
Set InputFile=%~dp0AutoSPInstallerInput.xml
...:**
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" -Command Start-Process "$PSHOME\powershell.exe" - noexit -Verb RunAs -ArgumentList ("&""%~dp0AutoSPInstallerMain.ps1""" """%InputFile%""")

By the way in relation to running everything from a central location I've added InstallationPaths to the Install node of the AutpSPInstallerInput.xml and updated the relevant functions in powershell script to use these. 
    <Install>
        <ConfigFile>config.xml</ConfigFile>
        <OfflineInstall>True</OfflineInstall>
        <Disable>
            <Loopback>False</Loopback>
            <UnusedServices>False</UnusedServices>
        </Disable>
      <!-- ** GHO IT: Added to manage the use of network shares -->
      <InstallationPaths>
        <PrerequisiteInstallerPath>\\files.group.local\packages\Microsoft\Office 2010 Servers\Installation Binaries\SharePoint Server 2010\PrerequisiteInstallerFiles</PrerequisiteInstallerPath>
        <SharePointInstallerPath>\\files.group.local\packages\Microsoft\Office 2010 Servers\Installation Binaries\SharePoint Server 2010\SP0 - 2010 Dec CU Slipstream</SharePointInstallerPath>
        <OfficeWebAppsInstallerPath>\\files.group.local\packages\Microsoft\Office 2010 Servers\Installation Binaries\Office Web Applications\SP0 - RTM</OfficeWebAppsInstallerPath>
      </InstallationPaths>
    </Install>