0
votes

Is it possible to create a simple WIX installer that only executes a Custom Action, and does nothing else? I know I can get it to work by using the following WIX markup, however this still creates a folder in the Program Files, and it doesn't work if I remove the CreateFolder line.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
 xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" 
 xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="RegisterDotNetISS" Language="1033" Version="1.0.0.0" Manufacturer="MyCompanyhere" UpgradeCode="67825899-d511-4cd3-a8c1-b2dd448a74bd">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

<PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR"/>
<PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR64"/>

<CustomAction Id='aspnetregiisi'  ExeCommand='"[NETFRAMEWORK40FULLINSTALLROOTDIR]\aspnet_regiis.exe" -i -enable' Directory='TARGETDIR' />
<CustomAction Id='aspnetregiisix64'  ExeCommand='"[NETFRAMEWORK40FULLINSTALLROOTDIR64]\aspnet_regiis.exe" -i -enable' Directory='TARGETDIR' />

<InstallExecuteSequence>
  <Custom Action="aspnetregiisi" After="CostFinalize">NOT VersionNT64</Custom>
  <Custom Action="aspnetregiisix64" After="CostFinalize">VersionNT64</Custom>
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="RegisterDotNetISS" >

      <Component Id="Component1"
                 Guid="{78E22868-B750-47EB-9E4C-C19CCA939394}">
        <CreateFolder />
      </Component>
    </Directory>
  </Directory>
</Directory>

<Feature Id="ProductFeature" Title="RegisterDotNetISS" Level="1">
  <ComponentRef Id="Component1" />
    </Feature>
</Product>

</Wix>

--EDIT-- I'm looking at creating a WIX installer rather than a console application because the .net 3.5 framework seems to have issues reading the 64bit registry. The easy functionality to do that was added in 4.0, and an empty installer that registers asp.net in IIS seems to work consistently.

1
What is the reason for making it? I guess it would be much easier to write a rather simple .exe which detects whether the system is 32 or 64 bit and then run the appropriate aspnet_regiis.exe.Alexey Ivanov
added an edit with my reasoning.Jason Kulatunga
Nevertheless, I think it would be easier to implement with an .exe file, although I meant a native executable. This can also be achieved via scripting, JScript on WSH, and it could be even easier.Alexey Ivanov

1 Answers

1
votes

It's called a "Trojan MSI" as it's looks like an MSI but doesn't behave anything like one. Some people @Microsoft have criticized this and yet some people (Microsoft again) have published them. (Read the comments..)

They can be quiet nice if it's what you need. Take a look at the "Mr FixIt's" that Microsoft puts out. Nice wizard UI driven by MSI that makes some change to your system but doesn't actually install anything.

So how to do it? Basically you have to supress a bunch of standard actions in the execute sequence so that directories don't get created and Features/Components/Products ectera don't get published to the MSI metabase that keeps track of what MSI has done.

You can do this by authoring a InstallExecuteSequence element along with child elements such as PublishProduct, PublishFeatures, PublishComponents, InstallFiles, CreateFolders and use the Suppres attribute to disable it.