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

or

<VS install location>\Setup\setup.exe /unattendfile d:\temp\myfile.ini

Comments (5)

  1. vbkatagi@gmail.com says:

    Hi,

    I am trying to install VS 2005 PRO by the method as suggested in your blog, i.e. by using relative path for INI file, but still getting the error of ‘The file \<IPAddress><Folder1><Folder2><Folder3><Folder4>1.0attempt2new was created for  operating system. Please contact your administrator to obtain the file for your operating system, Win XP’.Second error is related to ‘Processor’.

    1 I am using INI file particularly created on the same OS/Build

    2 path for INI is resolving properly(Which i have checked by msgbox) and even long path issue is also not there.

    3 The same code code works on some other build/OS.

    Please suggest how to proceed in this regard

    Thanks & Regards,

    Vishwanath K

    India

  2. Hi Vbkatagi@gmail.com – I’m sorry for the hassle that this issue is causing for you.  The VS unattended install logic does not allow for relative paths to the INI file – you have to pass in a fully qualified path.

    Can you please reply with the full command line you’re using to run setup.exe so I can take a look?