Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

April, 2009

  • Aaron Stebner's WebLog

    Silent install, repair and uninstall command lines for each version of the .NET Framework

    • 44 Comments

    I often get asked about how to perform silent and unattended installs for various versions of the .NET Framework.  In order to hopefully make things easier to find going forward, I decided to create a single blog post with information about silent and unattended installs, repairs and uninstalls for each shipping version of the .NET Framework.

    The command lines listed in this blog post do not apply to versions of the .NET Framework installed as a part of the OS.  You can refer to this blog post for a list of which version of the .NET Framework ships with which version of Windows.

    Note - if you try to repair or uninstall the .NET Framework and setup fails, you can try to use the .NET Framework Repair Tool to solve the problem.

    .NET Framework 1.0 product family

    .NET Framework 1.0 - silent repair

    dotnetfx.exe /q:a /c:"msiexec.exe /fpecmsu netfx.msi REBOOT=ReallySuppress /l*v %temp%\netfx10_repair_log.txt /qn"

    Note – repairing the .NET Framework 1.0 requires re-downloading the dotnetfx.exe installer and running the command line using this installer.

    .NET Framework 1.0 - unattended repair

    dotnetfx.exe /q:a /c:"msiexec.exe /fpecmsu netfx.msi REBOOT=ReallySuppress /l*v %temp%\netfx10_repair_log.txt /qb"

    Note – repairing the .NET Framework 1.0 requires re-downloading the dotnetfx.exe installer and running the command line using this installer.

    .NET Framework 1.0 - silent uninstall

    msiexec /x {B43357AA-3A6D-4D94-B56E-43C44D09E548} REBOOT=ReallySuppress /qn /l*v %temp%\netfx10_uninstall_log.txt

    Note - this command line varies depending on what language version of the .NET Framework 1.0 you have installed.  The product code listed above corresponds to the English version of the .NET Framework 1.0, so you will need to use the appropriate non-English product code in order to uninstall non-English versions of the .NET Framework 1.0.

    .NET Framework 1.0 - unattended uninstall

    msiexec /x {B43357AA-3A6D-4D94-B56E-43C44D09E548} REBOOT=ReallySuppress /qb /l*v %temp%\netfx10_uninstall_log.txt

    Note - this command line varies depending on what language version of the .NET Framework 1.0 you have installed.  The product code listed above corresponds to the English version of the .NET Framework 1.0, so you will need to use the appropriate non-English product code in order to uninstall non-English versions of the .NET Framework 1.0.

    .NET Framework 1.1 product family

    .NET Framework 1.1 - silent repair

    dotnetfx.exe /q:a /c:"msiexec.exe /fpecmsu netfx.msi REBOOT=ReallySuppress /l*v %temp%\netfx11_repair_log.txt /qn"

    Note – repairing the .NET Framework 1.1 requires re-downloading the dotnetfx.exe installer and running the command line using this installer.

    .NET Framework 1.1 - unattended repair

    dotnetfx.exe /q:a /c:"msiexec.exe /fpecmsu netfx.msi REBOOT=ReallySuppress /l*v %temp%\netfx11_repair_log.txt /qb"

    Note – repairing the .NET Framework 1.1 requires re-downloading the dotnetfx.exe installer and running the command line using this installer.

    .NET Framework 1.1 - silent uninstall

    msiexec /x {CB2F7EDD-9D1F-43C1-90FC-4F52EAE172A1} REBOOT=ReallySuppress /qn /l*v %temp%\netfx11_uninstall_log.txt

    .NET Framework 1.1 - unattended uninstall

    msiexec /x {CB2F7EDD-9D1F-43C1-90FC-4F52EAE172A1} REBOOT=ReallySuppress /qb /l*v %temp%\netfx11_uninstall_log.txt

    .NET Framework 2.0 product family

    .NET Framework 2.0 - silent repair

    %windir%\Microsoft.NET\Framework\v2.0.50727\install.exe /q

    .NET Framework 2.0 - unattended repair

    %windir%\Microsoft.NET\Framework\v2.0.50727\install.exe /qb

    .NET Framework 2.0 - silent uninstall

    %windir%\Microsoft.NET\Framework\v2.0.50727\install.exe /u /q

    .NET Framework 2.0 - unattended uninstall

    %windir%\Microsoft.NET\Framework\v2.0.50727\install.exe /u /qb

    .NET Framework 2.0 SP1 - silent repair

    msiexec /i {B508B3F1-A24A-32C0-B310-85786919EF28} REBOOT=ReallySuppress /l*v %temp%\netfx20sp1_repair_log.txt /qn

    .NET Framework 2.0 SP1 - silent uninstall

    msiexec /x {B508B3F1-A24A-32C0-B310-85786919EF28} REBOOT=ReallySuppress /l*v %temp%\netfx20sp1_uninstall_log.txt /qn

    .NET Framework 2.0 SP2 - silent repair

    msiexec /fpecmsu {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REBOOT=ReallySuppress REINSTALL=ALL /l*v %temp%\netfx20sp2_repair_log.txt /qn

    .NET Framework 2.0 SP2 - unattended repair

    msiexec /fpecmsu {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REBOOT=ReallySuppress REINSTALL=ALL /l*v %temp%\netfx20sp2_repair_log.txt /qb

    .NET Framework 2.0 SP2 - silent uninstall

    msiexec /x {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REBOOT=ReallySuppress /l*v %temp%\netfx20sp2_uninstall_log.txt /qn

    .NET Framework 2.0 SP2 - unattended uninstall

    msiexec /x {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REBOOT=ReallySuppress /l*v %temp%\netfx20sp2_uninstall_log.txt /qb

    .NET Framework 3.0 product family

    .NET Framework 3.0 - silent repair

    “%windir%\Microsoft.NET\Framework\v3.0\Microsoft .NET Framework 3.0\setup.exe” /q /f /norestart

    .NET Framework 3.0 - unattended repair

    “%windir%\Microsoft.NET\Framework\v3.0\Microsoft .NET Framework 3.0\setup.exe” /qb /f /norestart

    .NET Framework 3.0 - silent uninstall

    “%windir%\Microsoft.NET\Framework\v3.0\Microsoft .NET Framework 3.0\setup.exe” /q /remove /norestart

    .NET Framework 3.0 - unattended uninstall

    “%windir%\Microsoft.NET\Framework\v3.0\Microsoft .NET Framework 3.0\setup.exe” /qb /remove /norestart

    .NET Framework 3.0 SP1 - silent repair

    msiexec /i {2BA00471-0328-3743-93BD-FA813353A783} REBOOT=ReallySuppress /l*v %temp%\netfx30sp1_repair_log.txt /qn

    .NET Framework 3.0 SP1 - unattended repair

    msiexec /i {2BA00471-0328-3743-93BD-FA813353A783} REBOOT=ReallySuppress /l*v %temp%\netfx30sp1_repair_log.txt /qb

    .NET Framework 3.0 SP1 - silent uninstall

    msiexec /x {2BA00471-0328-3743-93BD-FA813353A783} REBOOT=ReallySuppress /l*v %temp%\netfx30sp1_uninstall_log.txt /qn

    .NET Framework 3.0 SP1 - unattended uninstall

    msiexec /x {2BA00471-0328-3743-93BD-FA813353A783} REBOOT=ReallySuppress /l*v %temp%\netfx30sp1_uninstall_log.txt /qb

    .NET Framework 3.0 SP2 - silent repair

    msiexec /fpecmsu {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REBOOT=ReallySuppress REINSTALL=ALL /l*v %temp%\netfx30sp2_repair_log.txt /qn

    .NET Framework 3.0 SP2 - unattended repair

    msiexec /fpecmsu {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REBOOT=ReallySuppress REINSTALL=ALL /l*v %temp%\netfx30sp2_repair_log.txt /qb

    .NET Framework 3.0 SP2 - silent uninstall

    msiexec /x {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REBOOT=ReallySuppress /l*v %temp%\netfx30sp2_uninstall_log.txt /qn

    .NET Framework 3.0 SP2 - unattended uninstall

    msiexec /x {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REBOOT=ReallySuppress /l*v %temp%\netfx30sp2_uninstall_log.txt /qb

    .NET Framework 3.5 product family

    .NET Framework 3.5 - silent repair

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /q /norestart

    .NET Framework 3.5 - unattended repair

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /qb /norestart

    .NET Framework 3.5 - silent uninstall

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /q /uninstall /norestart

    .NET Framework 3.5 - unattended uninstall

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /qb /uninstall /norestart

    .NET Framework 3.5 SP1 - silent repair

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\setup.exe" /q /norestart

    .NET Framework 3.5 SP1 - unattended repair

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\setup.exe" /qb /norestart

    .NET Framework 3.5 SP1 - silent uninstall

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\setup.exe" /q /uninstall /norestart

    .NET Framework 3.5 SP1 - unattended uninstall

    "%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5 SP1\setup.exe" /qb /uninstall /norestart

     .NET Framework 4 product family

    .NET Framework 4 Client Profile (32-bit) – silent repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

    .NET Framework 4 Client Profile (32-bit) – unattended repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Client Profile (32-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

    .NET Framework 4 Client Profile (32-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Client Profile (64-bit) – silent repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

    .NET Framework 4 Client Profile (64-bit) – unattended repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Client Profile (64-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

    .NET Framework 4 Client Profile (64-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Full (32-bit) – silent repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

    .NET Framework 4 Full (32-bit) – unattended repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Full (32-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /q /norestart

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

    .NET Framework 4 Full (32-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Full (64-bit) – silent repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

    .NET Framework 4 Full (64-bit) – unattended repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /passive /norestart

    .NET Framework 4 Full (64-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /q /norestart

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /q /norestart

    .NET Framework 4 Full (64-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\setup.exe /uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /uninstall /x86 /x64 /parameterfolder Client /passive /norestart

     .NET Framework 4.5 product family

    .NET Framework 4.5 (32-bit) – silent repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\setup.exe /repair /x86 /x64 /ia64 /q /norestart

    .NET Framework 4.5 (32-bit) – unattended repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\setup.exe /repair /x86 /x64 /ia64 /passive /norestart

    .NET Framework 4.5 (32-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\setup.exe /uninstall /x86 /x64 /q /norestart

    .NET Framework 4.5 (32-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\setup.exe /uninstall /x86 /x64 /passive /norestart

    .NET Framework 4.5 (64-bit) – silent repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\setup.exe /repair /x86 /x64 /ia64 /q /norestart

    .NET Framework 4.5 (64-bit) – unattended repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\setup.exe /repair /x86 /x64 /ia64 /passive /norestart

    .NET Framework 4.5 (64-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\setup.exe /uninstall /x86 /x64 /q /norestart

    .NET Framework 4.5 (64-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\setup.exe /uninstall /x86 /x64 /passive /norestart

    .NET Framework 4.5.1 (32-bit) – silent repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\v4.5.50938\setup.exe /repair /x86 /x64 /ia64 /q /norestart

    .NET Framework 4.5.1 (32-bit) – unattended repair

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\v4.5.50938\setup.exe /repair /x86 /x64 /ia64 /passive /norestart

    .NET Framework 4.5.1 (32-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\v4.5.50938\setup.exe /uninstall /x86 /x64 /q /norestart

    .NET Framework 4.5.1 (32-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\v4.5.50938\setup.exe /uninstall /x86 /x64 /passive /norestart

    .NET Framework 4.5.1 (64-bit) – silent repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v4.5.50938\setup.exe /repair /x86 /x64 /ia64 /q /norestart

    .NET Framework 4.5.1 (64-bit) – unattended repair

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v4.5.50938\setup.exe /repair /x86 /x64 /ia64 /passive /norestart

    .NET Framework 4.5.1 (64-bit) – silent uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v4.5.50938\setup.exe /uninstall /x86 /x64 /q /norestart

    .NET Framework 4.5.1 (64-bit) – unattended uninstall

    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v4.5.50938\setup.exe /uninstall /x86 /x64 /passive /norestart

    <update date="5/13/2010"> Added information about .NET Framework 4 install, repair and uninstall. </update>

    <update date="6/1/2010"> Fixed incorrect command lines for uninstall of the .NET Framework 4 extended. </update>

    <update date="5/26/2011"> Added a missing /norestart parameter to the .NET Framework 4 Full (64-bit) - silent uninstall command line. </update>

    <update date="4/22/2014"> Added information about .NET Framework 4.5 and 4.5.1 install, repair and uninstall. </update>

    <update date="4/30/2014"> Added a link to the .NET Framework Repair Tool. </update> 

  • Aaron Stebner's WebLog

    Mailbag: Do I need still need older versions of the .NET Framework on my system after installing .NET Framework 3.5 SP1?

    • 44 Comments

    Question:

    I recently installed the .NET Framework 3.5 SP1 on my system.  Afterwards, I looked in Add/Remove Programs, and it shows that I have all of the following versions of the .NET Framework installed on my system:

    • Microsoft .NET Framework 1.0
    • Microsoft .NET Framework 1.1
    • Microsoft .NET Framework 2.0 SP2
    • Microsoft .NET Framework 3.0 SP2
    • Microsoft .NET Framework 3.5 SP1

    Do I need any of these older versions of the .NET Framework now that I’ve installed the .NET Framework 3.5 SP1, or can I safely uninstall them?

    Answer:

    When you install the .NET Framework 3.5 SP1, it will also install the .NET Framework 2.0 SP2 and the .NET Framework 3.0 SP2 behind the scenes.  You cannot use the .NET Framework 3.5 SP1 unless you also have the .NET Framework 2.0 SP2 and 3.0 SP2 installed.  Therefore, you will not be allowed to uninstall the .NET Framework 2.0 SP2 or 3.0 SP2 if you have the .NET Framework 3.5 SP1 installed.  If you try to uninstall those versions of the .NET Framework, their uninstall processes will block and tell you that they are needed by another application on your system.

    The .NET Framework 1.0 and .NET Framework 1.1 can be installed side-by-side with the .NET Framework 2.0, 3.0 and 3.5.  Most applications that were created for the .NET Framework 1.0 or 1.1 will automatically use the .NET Framework 2.0 instead if it is installed on the system.  In most cases, that means you do not need to keep the .NET Framework 1.0 or 1.1 installed on your system if you already have the .NET Framework 2.0 installed.

    However, there are some applications that are configured to require a specific version of the .NET Framework, even if later versions of the .NET Framework are installed.  If you have any applications like that on your system and try to run them without installing the .NET Framework 1.0 or 1.1, you will get an error message that looks like the following:

    ---------------------------
    MyApplication.exe - .NET Framework Initialization Error
    ---------------------------
    To run this application, you first must install one of the following versions of the .NET Framework:
      v1.1.4322
    Contact your application publisher for instructions about obtaining the appropriate version of the .NET Framework.
    ---------------------------
    OK  
    ---------------------------

    In the above error message, the version number will be v1.0.3705 if you need to install the .NET Framework 1.0, and it will be v1.1.4322 if you need to install the .NET Framework 1.1.

    If you end up seeing any error messages like this, you can re-install the .NET Framework 1.0 or 1.1 in order to resolve the errors.  If you don't end up seeing any error messages like this, then you don't need to worry about re-installing the .NET Framework 1.0 or 1.1.

  • Aaron Stebner's WebLog

    How to detect whether or not Visual Studio 2008 SP1 is installed on a system

    • 3 Comments

    Question:

    I am trying to install an application that requires Visual Studio 2008 SP1 before it can successfully install.  How can I detect the presence of Visual Studio 2008 SP1?

    Answer:

    There is not an officially documented way of detecting VS 2008 SP1.  There are some registry keys that store service pack level values, but those keys have proven unreliable in scenarios where more than one edition of Visual Studio is installed on the system, so I would not recommend relying on them because they can give false results in some cases.

    The most reliable way I’ve seen to detect Visual Studio 2008 service pack level is to do the following:

    1. Look up the VS 2008 install location from the registry
    2. Build a full path to devenv.exe using the install location found in the registry
    3. Check the file version to make sure it is greater than or equal to 9.0.30729.1 (the VS 2008 SP1 version number)

    If you are using WiX v3.0 to build an MSI-based installer that will check for VS 2008 SP1, here is a fragment that will accomplish this:

    <Fragment>
      <Property Id="VS90_SP1" Secure="yes">
        <RegistrySearch Id="VS90DevEnvDirectorySearch" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS" Name="EnvironmentDirectory" Type="raw">
          <DirectorySearch Id="VS90DevEnvFilePathSearch">
            <FileSearch Id="VS90DevEnvFileVersionSearch" Name="devenv.exe" MinVersion="9.0.30729.1"/>
          </DirectorySearch>     
        </RegistrySearch>     
      </Property>
    </Fragment>

    The above property ships in WiX v3.0 in the WixVSExtension, so you could reference it directly from there in your setup authoring instead of redefining it yourself too.  You can find more information about how to do this in the WiX 3.0 WixVSExtension documentation.

    A note about VS 2008 Express Editions

    If you need to detect SP1 for one of the VS 2008 Express Editions, you can use similar logic to what is described above.  Instead of checking the file version of devenv.exe, you will need to check the file version for the Express Edition IDE file – vbexpress.exe, vcexpress.exe, vcsexpress.exe or vwdexpress.exe.

    You can look up the locations of the VS 2008 Express Edition IDE files by using the following logic:

    1. Look up the root installation directory for all editions of VS 2008 from the following registry key/value:

      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7]
      9.0

      For a default install, this registry value will be set to C:\Program Files\Microsoft Visual Studio 9.0\

    2. Append the sub-folders named Common7 and IDE to build a path that looks like C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\
    3. Append the name of the Express Edition IDE file you want to check the version for – vbexpress.exe, vcexpress.exe, vcsexpress.exe or vwdexpress.exe.

    WiX v3.0 also includes the following pre-defined detection properties for SP1 for each of the VS 2008 Express Editions:

    • VB90EXPRESS_SP1
    • VC90EXPRESS_SP1
    • VCS90EXPRESS_SP1
    • VWD90EXPRESS_SP1

    <update date="4/16/2009"> Added more detail about how to look up the locations of the Visual Studio Express Edition IDE files </update>

     

  • Aaron Stebner's WebLog

    Creating an MSI-based installer for an XNA Game Studio game that integrates with Windows Game Explorer

    • 10 Comments

    I’ve previously written a few posts about how to get started with Windows game deployment for games created with XNA Game Studio 3.0:

    The next thing I want to demonstrate is how to add Windows Game Explorer integration to your XNA Framework-based Windows game.  For this demonstration, I’m going to build on the sample installer for the XNA Game Studio 3.0 platformer starter kit that includes a Visual Studio bootstrapper (described in this blog post).

    Updated sample that builds an MSI and a bootstrapper that integrates with Windows Game Explorer

    I have posted an updated sample at http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog%7C_Tools/WiX%20Samples/wix%7C_sample%7C_xgs30%7C_game%7C_with%7C_bootstrapper%7C_and%7C_gdf.zip that extends my previous sample.  You can use it to create a bootstrapper and an MSI for the Platformer Starter Kit that will integrate the game with Windows Game Explorer during installation.

    It includes the following additions/changes from the previous sample:

    • The GDF folder contains the source files, a native resource script named Platformer1.rc, and a compiled native resource file named Platformer1.res that include the GDF file needed to integrate the Platformer Starter Kit with Windows Game Explorer.

      Note – I am not an expert regarding GDF file syntax, so I created a fairly simple GDF file using the GDF File Editor tool that ships in the DirectX SDK for the purposes of this sample.  For more advanced scenarios, please refer to the MSDN documentation for the GDF file schema and the GDF file editor.

    • The file Platformer.wxs has been updated to include <Game/>, <PlayTask/> and <SupportTask/> elements that are a part of the WixGamingExtension.  These elements will cause custom actions to be added to the MSI that will call Game Explorer APIs during installation and uninstallation.
    • The file build_wix_sample_xgs30_game.bat has been updated to add references to the WixGamingExtension to the Candle and Light command lines so that WiX will be able to successfully build the MSI with the new elements that have been added to Platformer.wxs.

    How to use the updated sample

    To build and try out this updated sample, you can use the following steps:

    1. Install Visual Studio 2008 or Visual C# 2008 Express Edition and XNA Game Studio 3.0.
    2. Install the latest build of WiX v3.0 from http://wix.sourceforge.net/releases/.
    3. Open Visual Studio and create a project using the Platformer Starter Kit (3.0) project template that is included as a part of XNA Game Studio 3.0.
    4. Download the sample from http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog%7C_Tools/WiX%20Samples/wix%7C_sample%7C_xgs30%7C_game%7C_with%7C_bootstrapper%7C_and%7C_gdf.zip.
    5. Create a sub-folder named Setup in the Platformer game project that you created above.
    6. Extract the contents of the Setup sub-folder in wix_sample_xgs30_game_with_bootstrapper_and_gdf.zip to the Setup folder created in step 5.
    7. Create a sub-folder named GDF in the Platformer game project that you created above.
    8. Extract the contents of the GDF sub-folder in wix_sample_xgs30_game_with_bootstrapper_and_gdf.zip to the GDF folder created in step 7.
    9. Open this copy of the Platformer Starter Kit in Visual Studio 2008 or Visual C# 2008 Express Edition, right-click on the Windows version of the game project in the VS Solution Explorer and choose Properties.
    10. In the Application tab, go to the Resources section and change select the radio button labeled Resource File.
    11. Browse to the file Platformer1.RES that is located in the GDF sub-folder that you created and extracted in steps 8-9 above.
    12. Save all of your project files.
    13. Build the x86 release version of the project.
    14. Run the script named build_wix_sample_xgs30_game.bat from the Setup folder to build an MSI and a bootstrapper setup.exe for the game.

    After doing the above, you can copy setup.exe and wix_sample_xgs30_game.msi from the Setup sub-directory to a server and run setup.exe to install your game and its prerequisites on another computer.  If you install the game on Windows Vista or Windows 7, you can go to Game Explorer (the Games folder on the Start menu) after installation, and you will see a shortcut there for the Platformer Starter Kit.  You can use this shortcut to play the game and/or view support information.  The shortcut will be removed from Game Explorer when you uninstall the game.

    How to implement Windows Game Explorer integration – general steps

    At a high-level, the steps required to implement Game Explorer integration for a Windows game are the following:

    1. Create a Game Definition File (GDF) with the appropriate information for your game
    2. Embed the GDF file as a resource in one of the binaries that is a part of your game
    3. Include logic into your installer to call Game Explorer APIs to register your game

    How to implement Windows Game Explorer integration – XNA Framework-specific details

    The Game Explorer APIs require that the GDF file be embedded as a native resource in order to correctly integrate with Windows Game Explorer.  An XNA Framework game is written in managed code, and native resources cannot be directly embedded into a managed binary without some additional steps.  To work around this, you can do one of the following:

    1. Create a stub native binary that includes the GDF file as a resource, and then include this native binary in your game installer
    2. Build a native resource file and embed it into one of your managed game assemblies

    For this example, I will use option #2 above.  As a result, there are a couple of additional steps that are required to include Game Explorer integration for an XNA Framework-based Windows game.  The steps look like the following:

    1. Create a Game Definition File (GDF) and native resource script (RC) file
    2. Build a native resource (RES) file from the RC file
    3. Embed the GDF file into one of your game binaries
    4. Include logic into your installer to call Game Explorer APIs to register your game

    See below for more details about how to accomplish each of these steps.

    1.  Create a Game Definition File (GDF) and native resource script (RC) file

    To create a GDF file, you can use the Game Definition File Editor that ships in the DirectX SDK.  The GDF Editor tool will create a file name *.GDFMakerProject, which will store the settings used to create the GDF file.  You can use this file to open the GDF project in the GDF Editor and make changes to the settings in the GDF file later on if needed.

    The Build Script for Project command in the GDF Editor will create a native resource script file (named *.rc) that you can use to compile a native resource file (named *.res) to embed into one of your game binaries in the next step.

    2.  Build a native resource (RES) file from the RC file

    In order to embed a GDF file into an XNA Framework game binary, you must first build a native resource (RES) file from the native resource script (RC) file that is generated by the GDF Editor tool described in step 1.  You can use the native resource compiler rc.exe that ships in the Windows SDK to compile an RC file into a RES file.  There is detailed information about RC.exe in this MSDN topic.

    Here are steps you can use to build a RES file from an RC file by using rc.exe:

    • Open a Visual Studio 2008 Command Prompt
    • Run this command line:  rc.exe /r <full path to your *.rc file>

    This command line will create *.RES in the same path as *.rc.

    If you only have Visual C# 2008 Express Edition, you will not have a VS 2008 Command Prompt shortcut.  You will need to manually run rc.exe from the Windows SDK directory (by default, this is located at %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin after installing Visual C# 2008 Express Edition).

    You could also add the rc.exe command line as a pre-build step in your game project if you would like to build the RES file each time you build your game project.

    3.  Embed the GDF file into one of your game binaries

    Once you have built a RES file that includes the GDF file for your game, you need to embed the RES file into one of the managed binaries that is a part of your game.  You can use the following steps in the Visual Studio IDE to accomplish this:

    • Open your game project in Visual Studio 2008 or Visual C# 2008 Express Edition, right-click on the Windows version of the game project in the VS Solution Explorer and choose Properties.
    • In the Application tab, go to the Resources section and select the radio button labeled Resource File.
    • Browse to the file *.RES that you built with rc.exe in step 2 above.
    • Save all of your project files.
    • Rebuild your game – the RES file (and therefore the GDF file) will now be embedded into your main game executable.

    For reference, the Resource File radio button ends up adding the following information to your game’s .csproj file:

    <Win32Resource>MyResourceFile.RES</Win32Resource>

    4.  Include logic into your installer to call Game Explorer APIs to register your game

    Once you have added a native resource (RES) file that includes your Game Definition File (GDF) to one of your game binaries, you need to add information to your installer to call Game Explorer APIs to register your game with Windows Game Explorer.  The instructions for how to call these APIs is described in more detail in this MSDN topic.  As you can see by looking at that MSDN topic, these instructions are fairly long and involved.  Fortunately, if you are using WiX v3.0 to create an MSI-based installer for your game, you can use the built-in WixGamingExtension to easily include custom actions to accomplish the steps listed in that MSDN topic.

    You must add the following information to your WiX authoring to include Game Explorer integration custom actions in your MSI:

    • Add a <Game/> element that is a child of the <File/> element that you embedded the RES file into in step 3 above.
    • Add a <PlayTask/> element that is a child of the <Game/> element.  This will register a command that will be run to play your game from Windows Game Explorer.
    • (optional) Add a <SupportTask/> element that is a child of the <Game/> element.  This will register a command that will launch a support web site for your game if the user selects the Community and Support option from Windows Game Explorer.

    For a specific example of this WiX authoring, refer to the <File/> element for Platformer1.exe in Platformer.wxs in the sample at http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog%7C_Tools/WiX%20Samples/wix%7C_sample%7C_xgs30%7C_game%7C_with%7C_bootstrapper%7C_and%7C_gdf.zip.

    <update date="4/14/2009"> Updated the text to refer to Windows Game Explorer instead of Windows Vista Game Explorer because the above sample will work on Windows 7 as well. </update>

     

  • Aaron Stebner's WebLog

    How to get the Platformer starter kit to appear if you install a new edition of VS 2008 after installing XNA Game Studio 3.0

    • 0 Comments

    We recently ran into an issue on the Creators Club forums that I wanted to describe in a bit more detail in case anyone else runs into it in the future.

    Description of the issue

    If you install one edition of Visual Studio 2008, then install XNA Game Studio 3.0, then install another edition of Visual Studio 2008, the Platformer starter kit will not be available in the New Project dialog in the 2nd edition of Visual Studio 2008.  Repairing XNA Game Studio 3.0 will cause most of the XNA Game Studio 3.0 project templates (such as Windows Game, Xbox 360 Game, Zune Game, etc) to appear in the New Project dialog in the 2nd edition of Visual Studio 2008.  However, repairing XNA Game Studio 3.0 will not cause the Platformer starter kit to appear in the 2nd edition of Visual Studio 2008.

    For example, the following scenario will result in the Platformer starter kit appearing in Visual C# Express but not appearing in Visual Studio 2008 Professional:

    1. Install Visual C# 2008 Express Edition
    2. Install XNA Game Studio 3.0
    3. Install Visual Studio 2008 Professional Edition
    4. Repair XNA Game Studio 3.0

    How to work around the issue

    If you run into this issue, you will need to use the following steps to work around it:

    1. Go to the folder %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup on your system, right-click on the file named platformer.msi and choose to uninstall it
    2. Go to Add/Remove Programs and choose to repair Microsoft XNA Game Studio 3.0.

    After performing the above steps, you should see the Platformer starter kit available in the Visual Studio new project dialog under the Visual C# | XNA Game Studio 3.0 node for each edition of Visual Studio 2008 that you have installed on your system.

  • Aaron Stebner's WebLog

    Links to information about WiX v3.0 and v3.5 schedules and roadmaps

    • 1 Comments

    Rob Mensching recently posted an item on his blog indicating that the WiX toolset will not be shipping in Visual Studio 2010 as originally planned.  In a follow-up post, he outlined a proposed roadmap for WiX v3.0 and v3.5.  To briefly summarize his post, the proposed WiX roadmap looks like the following:

    • Lock down WiX v3.0 and release it in July 2009 with the core toolset, extensions and Votive support for Visual Studio 2005 and 2008
    • Follow up with a WiX v3.5 release that includes Votive support for Visual Studio 2010 and the new chainer/bootstrapper (code name Burn); ship WiX v3.5 when Visual Studio 2010 ships.

    As part of locking down WiX v3.0, the v3.0.5217.0 build was declared release candidate 2 about a week ago.  If anyone reading this is working with WiX v3.0, I encourage you to upgrade to the RC2 build, try out your scenarios and report any issues you see on the WiX SourceForge bug reporting site in order to help the WiX virtual team lock down and ship WiX v3.0.

  • Aaron Stebner's WebLog

    Link to information about video playback support in XNA Game Studio 3.1

    • 2 Comments

    My colleague Michael Klucher posted a great introduction to the new video playback feature that is coming in XNA Game Studio 3.1 that I wanted to link to here as well.  He covers the following topics:

    • Introduction – what will you be able to do and what won’t you be able to do with video playback in XNA Game Studio 3.1?
    • What video formats are supported?
    • How to import a video into your XNA Game Studio 3.1 project in Visual Studio
    • Sample code to show how to load a video, start and stop playback and draw the frames

    I encourage you to check out his blog post at http://klucher.com/blog/video-support-in-xna-game-studio-3-1/ for more detailed information about how to use video playback functionality in the upcoming release of XNA Game Studio 3.1.

  • Aaron Stebner's WebLog

    Link to information about side-by-side versioning and XNA Game Studio 3.1

    • 0 Comments

    Stephen Styrchak recently posted an item on his blog that I wanted to link to here.  The post describes side-by-side versioning in the versions of XNA Game Studio that we have shipped so far and provides an introductory overview for how installation, versioning and project upgrades will work in the recently announced XNA Game Studio 3.1 release.

    Here is a summary of the key setup and Visual Studio project creation and project upgrade behaviors you will see once XNA Game Studio 3.1 is available:

    Setup behavior

    • You must uninstall XNA Game Studio 3.0 before you can install XNA Game Studio 3.1.
    • XNA Game Studio 3.1 will install and run side-by-side on the same system as XNA Game Studio 2.0, XNA Game Studio Express 1.0 and 1.0 Refresh, and Visual Studio 2005.
    • XNA Game Studio 3.1 will integrate into Visual C# 2008 Express Edition or up-level editions of Visual Studio 2008 (Standard, Professional, Team System, etc).

    Visual Studio project creation and upgrade behavior

    • XNA Game Studio 3.1 will allow you to create, open, build, deploy and debug both 3.0 and 3.1 games. You will not be required to upgrade a 3.0 game to 3.1 in order to continue to use it after installing XNA Game Studio 3.1.
    • Upgrading a 2.0 game to 3.0 will work exactly like it does today in XNA Game Studio 3.0. You will open the 2.0 project in Visual C# 2008 Express Edition or Visual Studio 2008 and use the built-in Visual Studio Conversion Assistant.
    • Upgrading a 3.0 game to 3.1 will be invoked manually by clicking on a new Upgrade Solution menu item that will appear for 3.0 projects. This menu item will upgrade all 3.0 projects in the currently selected solution to 3.1 (including game projects, content projects, game library projects and content pipeline extension library projects).
  • Aaron Stebner's WebLog

    Link to information about how to use Xbox LIVE Marketplace to advertise your Community Game

    • 0 Comments

    At GDC 2009, my colleague Michael Klucher presented a session at the XNA Lobby Bar titled Best Practices for Xbox LIVE Community Games.  This session covered several topics, including an overview of some of the best practices for developers to keep in mind as they create their games and a description of how to leverage play testing to identify bugs and game play issues prior to submitting your game for peer review.

    In addition to the above best practices that can be leveraged during game development, Michael presented some ideas that developers can use to advertise their games after they have been published to Xbox LIVE.

    Michael wrote a post on his blog last week to provide more detail about one of the ideas he presented in the session – how to find and use the links to your game’s page on Xbox LIVE Marketplace to advertise your game.  Every published Xbox LIVE Community Game automatically has a page created for it on Xbox LIVE Marketplace, and the techniques Michael describes on his blog can improve discoverability and make it easier for consumers to download and purchase your game.

    You can find detailed information about how to do this in the blog post at http://klucher.com/blog/leveraging-the-power-web-marketplace-for-xbox-live/.

    In the time since Michael wrote his blog post, a couple of folks posted information in this Creators Club forum post about a site they created at http://xblcg.info/ to index the Xbox LIVE Community Games.  This site allows developers to provide shorter, more friendly URLs for each game on Xbox LIVE Marketplace, which makes it even easier to implement the suggestions in Michael’s blog post.

    If you have created and published an Xbox LIVE Community Game, I encourage you to check out Michael’s blog post and the information on the forums for more information about a great option to advertise your game.

Page 1 of 1 (9 items)