AutoSPInstaller (http://autospinstaller.codeplex.com/) is a neat tool for unattended SharePoint install and configuration. I ran into an issue where AutoSPInstaller just seems to get stuck in a loop. After SP is installed, it prompted me to restart the server and re-run the script. I did this, but when I re-run the script it installs SP again and the loop goes on.
This problem was caused by the fact that I was running the AutoSPInstaller script under a 32 bits process.
In the AutoSPInstaller script, there is a line that looks like this:
If (Test-Path “$env:CommonProgramFiles\Microsoft Shared\Web Server Extensions\14\BIN\stsadm.exe”) #Crude way of checking if SP2010 is already installed
This line checks if the file stsadm.exe exists to determine if SP has been installed. If the file is not found, the script goes ahead and installs SP.
The problem is in the $env:CommonProgramFiles part, which is different under 32 vs 64 bits. This is why in my case the script keeps trying to install SP each time it is re-ran.
So how did I manage to run the script under a 32 bits process? Because I launched the script from an HTA :), and by default HTA launches under a 32 bits process. As a quick fix for this, I created a batch file that launches the 64 bits version of the HTA instead – which is at C:\Windows\System32\mshta.exe.