How to automatically uninstall DirectX 9? - wix

I am putting together a WiX installer that includes silently installing DirectX 9:
dxsetup.exe /silent
How do I tell WiX how to un-install DirectX? Is there another switch on the command line?
I need to be able to configure the installer to un-install DirectX automatically, else users complain if they can't uninstall.

For the DirectX End-User Runtime (aka DirectSetup or DXSETUP), it has long been recommended that you don't even try to uninstall it.
In any case, on most versions of Windows you can't 'uninstall' DirectX and running DXSETUP doesn't actually "Install DirectX" either as it's built into the OS. It can only be updated by installing a new version of the OS, installing a Service Pack, or applying a Windows Update. This applies to all versions of Windows starting with Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, and Windows XP x64 Edition.
DXSETUP is still useful for deploying stuff like legacy D3DX9, D3DX10, D3DX11, XACTEngine, XAudio 2.7, XInput 1.3, D3DCompile #43 or earlier, etc. It just doesn't ever install "DirectX".
See No So Direct Setup. If after reading this article you still think you need to run DXSETUP as part of your deployment, you should pick up the latest version of DXSETUP to avoid some potential issues, and trim it down to just those CABs you actually use in your application.

Related

can a directx executable be statically linked such that the redistributable dll's are not needed on the system?

Please can anyone tell me if it's possible to statically link in all the directx libs.
Basically can i build an exe that will run on any windows system that does not have the directx redistribu installed?
As noted, you can't statically link the "DirectX" libraries i.e. Direct3D, DirectInput, DirectSound, etc. That said, depending exactly on your definition of "any Windows system" you actually do not need the DirectX "Redist". It doesn't do what you think it does. See Not So DirectSetup for the a longer discussion of this.
If you use Direct3D 9 or later, DirectDraw, DirectSound 8, DirectInput 8, DirectShow, DirectMusic, DirectPlay, etc. i.e. what historically has been called "DirectX 9.0c" (aka the Summer 2004 release), those bits are always present on Windows starting with Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, and Windows XP x64 Edition. Therefore, as long as you require those as your minimum OS (or something greater), you don't need any DirectX Redist because it doesn't actually install any of those things. Take a look at What's in a version number? for examples of the "you must be this high to ride this ride" checks that guarantee this. Supporting Windows 2000, Windows 9x, or Windows ME or even Windows XP RTM/SP1 these days seems way out of scope.
For Direct3D 11, read Direct3D 11 Deployment for Game Developers. Direct3D 11.0 is built into Windows 8.x and Windows 7. It is on Windows Vista Service Pack 2 with KB 971644 installed which was pushed by Windows Update so it's basically everywhere.
Where it gets murky is if you are using other stuff in the DirectX SDK:
All versions of D3DX9, D3DX10, and D3DX11 are deprecated (see MSDN). If you depend on these, you still need the legacy DirectSetup. The good news is that with Direct3D 11, you don't need to use it at all. Instead see Living without D3DX for a bunch of new support libraries that are statically linked to your application as well as available shared-source--which includes DirectX Tool Kit mentioned in the other answer.
The HLSL compiler is not actually in D3DX anymore, and if you use the Windows 8.x SDK version of D3DCompile you can deploy that DLL side-by-side with your application avoiding the need for the DirectX Redist. See HLSL, FXC, and D3DCompile. Note that this DLL only supports Windows Vista or later, so runtime HLSL compilation on Windows XP still requires the legacy DirectX SDK and DirectX Redist. If you pre-build your shaders and are not using the Effects (FX) framework, this is not an issue.
If you use XINPUT, you should use XINPUT 9.1.0 (the original version) unless you are specifically using the headset audio features of XInput 1.3. This version is built into Windows Vista and later. If you require Windows 8.0 or later, you can use XInput 1.4. See XINPUT and Windows 8. Note that Server editions of Windows do not have XInput 9.1.0 or 1.4.
If you are using XAUDIO2, then you have a choice to make. If you require Windows 8.0 or later, then you can use XAudio 2.8 as it's built-in to the OS. Otherwise you need to use XAudio 2.7 which still requires the legacy DirectX REDIST to deploy. See XAudio2 and Windows 8.
If you use XACT, then you have to use the legacy DirectX REDIST as that's the only way to deploy the XACT engine.
If you are using the legacy DirectX Managed Assemblies for .NET 1.1, you should move to something else like SlimDX or SharpDX for a host of reasons. See DirectX and .NET
If you are making use of other "DirectX" things, you should read DirectX SDKs of a certain age for some guidance. In short: Don't use Direct3D Retained Mode, DirectPlay Voice, or DirectX 7/8 Visual Basic 6.0 as they aren't in the OS starting with Windows Vista.
No, the DirectX redist binaries are not available as static libs, though most of the useful functionality is now available as source in the DirectX Tool Kit.

wix burn installer requirements

I was looking for some documentation which will explain what requirements of my installer will be if I made it with wix and burn...
I`m still not sure about that because that information is hard to get...
When I was looking for an answer i found dependency of VC++redist... so it is telling me if I wrote custom action in c++ I need to have these on my target machine?
Also If I want to have my own UI, using burn... automatically I need .net framework 3.5?
I want to write installer, with custom actions and custom UI, I don`t mind which language use to write custom action (c++ or c#) but I want to be able to use my installation on winxp...
So if anybody have some info about requirements of installers... I did just couple of simple installers... all of them are running on win7 all right... but what about winxp? Thanks
Note that WiX is not an installation environment of its own. To put it simply, it is a comfortable, XML-style way to describe your installation requirements that gets translated into Windows Installer .msi databases by its compiler and linker. In this respect, WiX is a relatively thin wrapper around Windows Installer technology, and while it does provide extra features to help the setup developers, its abilities are dictated by the underlying technology and its limitations are not of its own but the limitations of Windows Installer itself.
System Requirements from Windows Installer 3.1 shows this:
Supported Operating System
Windows 2000 Service Pack 3, Windows 2000 Service Pack 4, Windows Server 2003, Windows XP, Windows XP Service Pack 1, Windows XP Service Pack 2
Windows Installer 3.1 Redistributable supports Windows 2000 with Service Pack 3 or later, Windows XP, Windows XP Service Pack 1, Windows XP Service Pack 2 and Windows Server 2003. Windows Server 2003 Service Pack 1 contains Windows Installer 3.1 and therefore can't be installed or upgraded by this redistributable.
So it should work like a charm on xp machines.
Sources:
WIX Tutorial
MSDN

LUA patching an application not installed from 'removable media' (XP)

There is a limitation with LUA (non-administrative) patching an application on XP when the original installation was not done from removable media (when using Windows Installer 3). This limitation has apparently been removed in Windows Installer 4
For such an installed application, would upgrading Windows Installer to v4 permit me to LUA-patch the application? Or does the fact that the app was originally installed using Installer v3 limit me?

Is it really necessary to use Windows Vista or higher to develop for Microsoft Surface?

I tried to start developing for Microsoft Surface. For that I first installed Visual Studio 2008. Then I followed this guide:
http://msdn.microsoft.com/en-us/library/ee804897.aspx
However there it says that only Windows Vista is supported. I'm still running Windows XP on my laptop and old PC and I don't want to update if not absolutely necessary. So I wonder if it is really necessary to use Windows Vista or if it is just a recommendation.
I already tried to install it on Windows XP, but every time i start the Surace SDK installer, the following error message appears:
This installation package cannot be
installed by the Windows Installer
service. You must install a Windows
service pack that contains a newer
version of the Windows Installer
service.
So I was wondering if this is the problem because I don't use Windows Vista. And if not, how can I solve this problem?
Yep, probably.
You can try installing the latest version of Windows installer.
http://support.microsoft.com/kb/942288
Windows vista is definitely required. I can't tell you if this is an artificially imposed requirement, or a physical incompatibility, but vista has been a requirement to install the SDK since was first released to Microsoft partners.
surface has a number of hard Vista dependencies. DWM is the most obvious one

Is it possible to target x64 .msi with WiX on a 32bit machine?

I'm developing SharePoint solutions on a virtual 32bit machine, and I use Wix to package the setup.
I'm targeting both 32bit and 64bit environments with my solutions, but in order to create 64bit MSI's, I need to have have a 64bit machine and the 64bit version of WiX.
Normally, this wouldn't be an issue, since I would have just simply use a 64bit dev environment.
But there are some issues with developing SharePoint solutions on a 64bit platform, which more or less forces me to develop on the 32bit platform.
Because of that, I can't create a 64bit MSI's, unless I copy the source files to a 64bit machine just to build the 64bit MSI, which feels a little bit cumbersome.
Is there any trick to flag/build the 64bit MSI package on my 32bit dev box, if it's even possible?
You do not need to run a 64-bit development machine to create a 64-bit MSI file.
What makes an MSI file "64-bit" is simply that the "Template Summary" field in the Summary Information Stream is set to "AMD64;1033" (one possible example) instead of "Intel;1033".
This MSDN article might provide you more information.
AFAIK the Wix tools set is agnostic to platform, you need to install the x64 version, and you need to use the proper flags inside the setup (there are various of places you need to be explicit about x64, more info here).