Visual Studio setup /createtransform mode fails when the source files are marked read-only


Recently, a customer reported an issue to me with Visual Studio 2005 setup, and I have verified that this issue exists in both Visual Studio 2005 and Visual Studio 2008 setup.  I want to describe the details about this issue and how to work around it in case anyone else runs into it while trying to deploy VS 2005 and/or VS 2008 on their networks.

Description of this issue

Both Visual Studio 2005 and Visual Studio 2008 setup have an administrator install mode that allows you to create a Windows Installer transform (MST) to enable deployment of Visual Studio via a Group Policy object in an Active Directory environment.  This mode is invoked by running <VS Install Path>\setup\setup.exe /CreateTransform <path to MST file> (an example is described in the Visual Studio 2005 deployment readme.

Behind the scenes, when VS setup is run with the /CreateTransform switch, it copies the original MSI file (vs_setup.msi) to the %temp% directory in order to modify it and create a transform based on those modifications.  However, it does not modify the file attributes when copying the MSI to %temp%.

This means that if the MSI is marked as read-only, it will be copied to %temp% as a read-only file, and then setup will fail because it cannot modify the read-only MSI file in order to to create the transform in this scenario.

The most common case where this bug is encountered is by running setup with the /CreateTransform switch directly from a VS installation CD or DVD.  In most cases, the files are copied to %temp% with read-only attributes when setup is run from CD/DVD media.  This bug can also occur if you run VS setup from a network path where the files staged to the network have been marked as read-only.

How to work around this issue

In order to work around this bug, you will need to make sure that the VS setup files are not marked as read-only before running setup with the /CreateTransform switch.  The easiest way to achieve this is to copy the contents of the installation CDs/DVD to a network share and then verify that the files are not marked read-only by right-clicking on the root folder and verifying that the read-only attribute is unchecked.

Comments (4)

  1. colin@bowern.com says:

    I’m hitting something that doesn’t seem to relate to the read-only attribute (it has been unflagged from the msi):

    [06/12/08,11:57:01] MSDN Library for Visual Studio 2008 – ENU: [2] MsiViewExecute failed in CRootComponent::ExecuteInsertUpdateQuery – err 1627

    [06/12/08,11:57:01] MSDN Library for Visual Studio 2008 – ENU: [2] Failing Query:UPDATE `Property` SET `Property`.`Value` = ” WHERE `Property`.`Property` = ‘PIDKEY’

    [06/12/08,11:57:01] MSDN Library for Visual Studio 2008 – ENU: [2] CRootComponent::ModifyTransformDB  – Failed to execute insert update query (2)

    [06/12/08,11:57:01] MSDN Library for Visual Studio 2008 – ENU: [2] CRootComponent::CreateTransform  – Failed to modifytransform DB

    [06/12/08,11:57:01] MSDN Library for Visual Studio 2008 – ENU: [2] CRootComponent::CreateTransform failed ford:msdn.mst

    [06/12/08,11:57:01] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147023293.

    [06/12/08,11:57:02] VS70pgui: [2] DepCheck indicates MSDN Library for Visual Studio 2008 – ENU is not installed.

  2. astebner says:

    Hi Colinbo – You’re right, this error doesn’t appear to be related to read-only settings on the MSI.  This error is coming from the MSDN setup, not the main VS setup, but I haven’t seen this type of error before.  Can you list the exact command lines that you ran and which setup EXE(s) you ran them for when you got this error?