Two of my attachments got clobbered on the way, so I am copy+pasting them here.

(1) ServiceInstaller.wxs

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
  <Product Id="*" Name="product name" Language="1033" Version="1.0.0.0" 
Manufacturer="manufacturer name" 
UpgradeCode="{C14D63B3-E9F0-45cf-A86E-B609E48CC642}">
    <Package Id="*" InstallerVersion="300" Compressed="yes" />

    <!-- Allow only an administrator to install on the target machine -->
    <Condition Message="You need to be an administrator to install Network 
Client on this machine">
      Privileged
    </Condition>
    
    <!-- Check for .NET 2.0 or higher -->
    <Condition Message="Network Client requires .NET Framework 2.0 or higher">
      Installed OR <![CDATA[MsiNetAssemblySupport >= "2.0.50727"]]>
    </Condition>

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <UI>
      <UIRef Id="WixUI_FeatureTree"/>
      <UIRef Id="WixUI_ErrorProgressText"/>
    </UI>

    <!-- Define installation directory structure -->
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="NewId_Company" Name="Company">
          <Directory Id="NewId_Product" Name="Product">
            <Directory Id="NewId_NC_InstallLocation" Name="bin" />
          </Directory>
        </Directory>
      </Directory>
    </Directory>

    <DirectoryRef Id="NewId_NC_InstallLocation">
      <Component Id="NewId_NetworkClient.exe" 
Guid="{211B0BD3-ECB8-4fcb-9006-D8B33E1C092E}">
        <File Id="NewId_NetworkClient.exe" KeyPath="yes" DiskId="1" 
Source="$(var.NFAQ.NetworkClient.TargetDir)\NetworkClient.exe" />
      </Component>
      <Component Id="NewId_IUConfig.xml" 
Guid="{5B70C6EE-D3C9-46b4-B23E-1738E481631E}">
        <File Id="NewId_IUConfig.xml" KeyPath="yes" DiskId="1" 
Source="IUConfig.xml" />
      </Component>
    </DirectoryRef>

    <Feature Id="NewId_NetworkClientFeature" Title="Network Client" Level="1" 
AllowAdvertise="yes">
      <ComponentRef Id="NewId_NetworkClient.exe"/>
      <ComponentRef Id="NewId_IUConfig.xml"/>
    </Feature>

    <!-- Install/Uninstall/Commit/Rollback Network Client Master Service -->
    <Binary Id="NewId_InstallUtil" 
SourceFile="C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll" />

    <CustomAction Id="NewId_InstallServiceSetProp" 
Property="NewId_InstallService" Value="/installtype=notransaction 
/action=install /LogFile= &quot;[#NewId_NetworkClient.exe]&quot; 
&quot;[NewId_NC_InstallLocation]IUConfig.xml&quot;"/>
    <CustomAction Id="NewId_InstallService" BinaryKey="NewId_InstallUtil" 
DllEntry="ManagedInstall" Execute="deferred" Impersonate="no"/>

    <CustomAction Id="NewId_UnInstallServiceSetProp" 
Property="NewId_UnInstallService" Value="/installtype=notransaction 
/action=uninstall /LogFile= &quot;[#NewId_NetworkClient.exe]&quot; 
&quot;[NewId_NC_InstallLocation]IUConfig.xml&quot;"/>
    <CustomAction Id="NewId_UnInstallService" BinaryKey="NewId_InstallUtil" 
DllEntry="ManagedInstall" Execute="deferred" Impersonate="no"/>

    <CustomAction Id="NewId_CommitServiceSetProp" 
Property="NewId_CommitService" Value="/installtype=notransaction /action=commit 
/LogFile= &quot;[#NewId_NetworkClient.exe]&quot; 
&quot;[NewId_NC_InstallLocation]IUConfig.xml&quot;"/>
    <CustomAction Id="NewId_CommitService" BinaryKey="NewId_InstallUtil" 
DllEntry="ManagedInstall" Execute="commit"/>

    <CustomAction Id="NewId_RollbackServiceSetProp" 
Property="NewId_RollbackService" Value="/installtype=notransaction 
/action=rollback /LogFile= &quot;[#NewId_NetworkClient.exe]&quot; 
&quot;[NewId_NC_InstallLocation]IUConfig.xml&quot;"/>
    <CustomAction Id="NewId_RollbackService" BinaryKey="NewId_InstallUtil" 
DllEntry="ManagedInstall" Execute="rollback"/>

    <InstallExecuteSequence>
      <Custom Action="NewId_UnInstallServiceSetProp" 
After="MsiUnpublishAssemblies" />
      <Custom Action="NewId_UnInstallService" 
After="NewId_UnInstallServiceSetProp" />

      <Custom Action="NewId_InstallServiceSetProp" After="StartServices" />
      <Custom Action="NewId_InstallService" After="NewId_InstallServiceSetProp" 
/>

      <Custom Action="NewId_RollbackServiceSetProp" 
After="NewId_InstallService" />
      <Custom Action="NewId_RollbackService" 
After="NewId_RollbackServiceSetProp" />

      <Custom Action="NewId_CommitServiceSetProp" After="NewId_RollbackService" 
/>
      <Custom Action="NewId_CommitService" After="NewId_CommitServiceSetProp" />
    </InstallExecuteSequence>

  </Product>
</Wix>


(2) IUConfig.xml

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>
 <startup>
  <supportedRuntime version="2.0.50727" /> 
  </startup>
</configuration>


Thank you,
Raz


-----Original Message-----
From: Rajendra Magar [mailto:rma...@newfrontieradvisors.com] 
Sent: Tuesday, February 23, 2010 2:48 PM
To: 'wix-users@lists.sourceforge.net'
Subject: [WiX-users] Problem installing a .NET installer-based service using 
InstallUtilLib.dll

Hi,

I am working on a Visual Studio WiX project to install a .NET installer-based 
service using InstallUtilLib.dll/ManagedInstall. I was following the 
instructions in the following link.

http://blog.vagmim.com/2004/09/installing-windows-services-created.html

The preceding link uses InstallUtilLib.dll from .NET version 1.0 whereas I am 
using InstallUtilLib.dll from .NET version 2.0.
When I tried to install the generated msi on a Vista machine, I got "Error 
2869: The dialog ErrorDlg has the error style bit set, but is no an error 
dialog".
When I tried to install on an XP machine, I got "InstallUtilLib.dll: Unknown 
error". I am attaching the verbose logs from both installation instances.
I looked into the logs and also searched around in online forums but I can't 
seem to find a way to fix these errors by manipulating my WiX input.

While I know that the author of the above link and Rob Mensching don't 
recommend installing services using a managed code custom action, I have no 
choice at the moment. :(
Could someone please be kind with me and tell me what I could do to get my msi 
to install correctly? I am also attaching my WiX source and the config file 
used by InstallUtilLib.dll

Sincerely,
Raz Magar


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to