Error trying to deploy Visual Studio using a relative path to the unattended INI file
I have heard from a couple of customers recently who have hit an error while trying to install Visual Studio 2005 in unattended mode using an INI file. In their scenarios, the setup process started and then almost immediately exited and VS ended up not installing correctly.
On their systems, VS 2005 unattended setup produced a log file named %temp%\AdminBaselineErrorLog.txt that showed errors like the following:
Setup discovered the following problems:
1. The file myfile.ini was created for operating system. Please contact your administrator to obtain the file for your operating system, Win .NET.
2. The file myfile.ini was created for processor type. Please contact your administrator to obtain the file for your processor type, AMD64.
In the cases I've seen so far, the customers were launching VS setup in unattended mode using a command line like the following:
<VS install location>\Setup\setup.exe /unattendfile myfile.ini
The key thing here is that in this command line, the path to the INI file only listed the file name and not the fully qualified path, including the directory where the INI file was located. When a relative path to the INI file is used, the GetPrivateProfileSection and GetPrivateProfileString APIs that VS setup uses behind the scenes to read the contents of the INI file will fail, and the values for operating system and processor architecture will be set to default blank values. This causes VS setup to not be able to identify what OS and processor architecture the INI file should apply to, and setup exits without attempting to install anything.
The workaround in this type of scenario is to change the command line being used to launch VS setup in unattended mode to pass in the full path to the INI file. For example:
<VS install location>\Setup\setup.exe /unattendfile \\myserver\myshare\myfile.ini
<VS install location>\Setup\setup.exe /unattendfile d:\temp\myfile.ini