1

I recently finished my first Wix Intaller, however I have a problem, My MSI file only works on my computer, I am generating an embedded CAB file. I am registering a DLL within the installer. I get the error : "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected." This is why I believe the DLL is part of the problem. I have some code snippets below, if you need to see more let me know, Thanks!

Custom Action for DLL Install:

<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111"
          Name="FP7000 Camera App" Version="1.0" Manufacturer="Stryker Corp" Language="1033">
    <Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/>
    <Media Id="1" Cabinet="product.cab" EmbedCab="no"/>

<!--Installing/Uninstalling Supporting Programs and DLLs-->
 <CustomAction Id="RegisterFP7000"
              Directory="dirCF50D58BC65CC93005501980AACC3EDD"
              ExeCommand='C:\Windows\system32\regsvr32.exe /s "C:\Projects\Stryker\Install Files\DLLs\FP7000-Camera.dll"'>
</CustomAction>

<CustomAction Id="UnregisterFP7000"
              Directory="dirCF50D58BC65CC93005501980AACC3EDD"
              ExeCommand='C:\Windows\system32\regsvr32.exe /s /u "C:\Projects\Stryker\Install Files\DLLs\FP7000-Camera.dll"'>
</CustomAction> 

<CustomAction Id="InstallSDK"
             Directory="dirCF50D58BC65CC93005501980AACC3EDD"
             ExeCommand='C:\Windows\system32\msiexec /i "C:\Projects\Stryker\Install Files\Included Apps\Intel_Media_SDK_2016_R2.msi" /quiet'
             Execute='deferred'
             Impersonate='no'
             Return='asyncNoWait'>
</CustomAction>

<CustomAction Id="UninstallSDK"
              Directory="dirCF50D58BC65CC93005501980AACC3EDD"
              ExeCommand='MsiExec.exe /X{C39967EA-A3DB-4B49-9BCA-74E4D0007533}'
              Execute='deferred'
              Impersonate='no'
              Return='asyncNoWait'>
</CustomAction> 

Install Sequence:

<InstallExecuteSequence>
      <Custom Action="RegisterFP7000" After="InstallFinalize">NOT Installed</Custom>
      <Custom Action="UnregisterFP7000" Before="InstallFinalize">REMOVE="ALL"</Custom> 
      <Custom Action="InstallSDK" After="InstallFiles">NOT Installed</Custom>
      <Custom Action="UninstallSDK" Before="InstallFinalize">REMOVE="ALL"</Custom>
</InstallExecuteSequence>
Isabel Inc
  • 1,871
  • 2
  • 21
  • 28
Tyler Tallo
  • 111
  • 2
  • 5
  • In general you can ask a better question about a Windows Installer error by finding the parts in the verbose MSI log that refer to the error. Then you'd know for certain what is failing and could ask more pointed questions about it. – Michael Urman Aug 24 '16 at 12:06
  • Ill keep that in mind! – Tyler Tallo Aug 24 '16 at 15:09

3 Answers3

4

Registration failures of this sort are typically because the Dll won't load because it has missing dependencies (assuming that everything else is correct). Other issues might include running the wrong bitness of regsvr32 (for example the 64-bit version) and trying to register a 32-bit Dll.

In any case, there is no need to do this. The best practice and recommended way to do this is to use Heat.exe to harvest the registration data into a wxs file, so the install will just create the correct registry entries when you do the install.

How do you register a Win32 COM DLL file in WiX 3?

Community
  • 1
  • 1
PhilDW
  • 20,260
  • 1
  • 18
  • 28
1

First of all, create a verbose log file for your setup so you can find error messages logged by msiexec:

msiexec.exe /i c:\setup.msi /QN /L*V "C:\Temp\msilog.log"

Quick explanation:

 /L*V "C:\Temp\msilog.log"= verbose logging
 /QN = run completely silently
 /i = run install sequence 

Open the log file and search for "value 3" as explained here: http://robmensching.com/blog/posts/2010/8/2/the-first-thing-i-do-with-an-msi-log/

Source Links:


EDIT: Looking over your code again I am pretty sure the problems are:

  1. You install an embedded runtime setup via a custom action. This should not be run via a custom action but as a pre-requisite setup run before your own MSI file.
  2. You specify hard coded paths to the dll rather than installing the dll to the main installation directory and registering it there. This means the setup will only work on your system since that is the only machine with the dll available in that particular location.

I am leaving in the previous, longer answer that I wrote first:


Just in addition to Phil's answer: installing the Intel SDK setup as a custom action is not advisable. MSI prohibits running two concurrent InstallExecuteSequence sessions and this could very well be the cause of the error you are seeing.

Try removing your custom actions currently used to install the MSI and instead run the SDK setup first as part of a chained install of your two MSI files to see if this resolves the problem.

COM files should not be registered using self-registration for many reasons:

Other than that, if you insist on using self-registration, you should not use any hard coded paths when compiling an MSI file. Overlooking the fact that you should register COM files as Phil points out using proper COM extraction, the path to regsvr32.exe should be removed in favor of an AppSearch / FileSearch entry that will locate the regsvr32.exe on the system you are installing to. The DLL should be installed to a local path under %ProgramFiles%\Your Company Name\Your Project Name\ or similar and then registered to run from there. The resulting WIX code would be something like:

ExeCommand='[PATHTOREGSVR32]regsvr32.exe /s "[INSTALLDIR]FP7000-Camera.dll"'>

Perhaps have a read of these article too:

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
0

Adding a shorter answer with a code sample, leaving in my other answer for now:

  • You need to install the FP7000-Camera.dll file to a directory under Program Files and register it there. Here is a quick mock-up from a sample found on CodeProject: http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with

      <?xml version="1.0"?>
      <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
         <Product Id="*" UpgradeCode="put-guid-here" 
                 Name="Example Product Name" Version="0.0.1"
                 Manufacturer="Example Company Name" Language="1033">
        <Package InstallerVersion="200" Compressed="yes" 
                 Comments="Windows Installer Package"/>
    
      <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
      <Directory Id="TARGETDIR" Name="SourceDir">
         <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLDIR" Name="Example">
               <Component Id="FP7000-Camera.dll" Guid="*">
                  <File Id="FP7000-Camera.dll" Source="replace with path to FP7000-Camera.dll"/>
               </Component>
            </Directory>
         </Directory>
      </Directory>
    
        <Feature Id="DefaultFeature" Level="1">
          <ComponentRef Id="FP7000-Camera.dll"/>
        </Feature>
    
       </Product>
      </Wix>
    
  • You should also remove the self-registration of the dll and instead add the COM registration to the component installing the file to disk. See a sample here: How do you register a Win32 COM DLL file in WiX 3? (run the Wix tool heat.exe to generate the COM data to include in your component). If you do this properly there is no need to self-register the file and you can remove the custom actions to do so.

  • Finally you should not install the SDK runtime MSI as a custom action, but run it first as a pre-requisite for your MSI.
Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164