Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
506 views
in Technique[技术] by (71.8m points)

wix c# app doesn't launch after installing

I have already successfully generated and successfully installed my C # WPF application with Wix. The application includes Crystal report dll and some other dll like Zen Barecode. After an nth attempt to modify the main project, the MSI is able to install itself but by launching the application either from the shortcuts or the executable directly, it does not start.

Here is my wix product.wxs

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
           Name="MyApp 1.0.0"
           Language="1036"
           Codepage="1252"
           Version="1.0.0"
           Manufacturer="My Company"
           UpgradeCode="PUT-GUID-HERE">
    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine"
             Description="Some description"
             Keywords="Some keywords"
             Comments="(c) some comments"
             />

    <MajorUpgrade DowngradeErrorMessage="La dernière version de MyApp est déjà installée" />
    <MediaTemplate EmbedCab="yes" />

    <Icon Id="icon.ico" SourceFile="$(var.InstallFolderPath)logo.ico"/>

    <Feature Id="ProductFeature" Title="TPI SOFT" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentGroupRef Id="LibrariesComponents" />
      <ComponentGroupRef Id="CustomFonts" />
      <ComponentRef Id="CMP_MenuShortcut" />
      <ComponentRef Id="CMP_DesktopShortcut" />
    </Feature>

    <Property Id="ARPPRODUCTICON"
              Value="icon.ico" />

    <Property Id="ARPCONTACT"
              Value="My Contact"/>

    <PropertyRef Id="NETFRAMEWORK45"/>
    <Condition Message="Ce logiciel requiert l'installation préalable de Microsoft .NET Framework 4.5 ou plus.">
      <![CDATA[Installed OR NETFRAMEWORK45]]>
    </Condition>

    <Condition Message="Ce logiciel tourne sur tous les systèmes Windows à partir de Windows Vista">
      <![CDATA[Installed OR VersionNT >= 600]]>
    </Condition>

    <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
    <UIRef Id="WixUI_InstallDir" />

    <WixVariable Id="WixUILicenseRtf"
                 Value="$(var.InstallFolderPath)licence.rtf" />

    <WixVariable Id="WixUIDialogBmp"
                 Value="$(var.InstallFolderPath)dialog_bmp.bmp"/>

    <WixVariable Id="WixUIBannerBmp"
                 Value="$(var.InstallFolderPath)op_banner.bmp"/>

    <Property Id="ApplicationFolderName"
              Value="MyAppMyApp" />

    <Property Id="WixAppFolder"
              Value="WixPerMachineFolder" />

  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="COMPANYFOLDER" Name="My Company">
          <Directory Id="APPLICATIONFOLDER" Name="My App 1.0.0">
          </Directory>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="MyStartMenuShortcutDir"
                   Name="My App"/>
      </Directory>

      <Directory Id="DesktopFolder">

      </Directory>

      <Directory Id="FontsFolder">

      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
      <Component Id="cmp436C9F728138518252041AF1E09808A9" Guid="PUT-GUID-HERE">
        <File Id="filC9EEE3E54616B953432FF36EDA3020A3" KeyPath="yes" Source="$(var.MyApp.TargetDir)MyApp.exe" />
      </Component>
      <Component Id="cmp840D318334E734AB5C8FA4C807C4CB95" Guid="PUT-GUID-HERE">
        <File Id="filE698BF079DEBA8E2BC7F2E69833E372D" KeyPath="yes" Hidden="yes" Source="$(var.MyApp.TargetDir)MyApp.exe.config" />
      </Component>

      <Component Id="CMP_Licence"
                 Guid="558784B2-E92A-4686-95BD-A034E859E8A7">
        <File Id="licence"
              Source="$(var.InstallFolderPath)licence.rtf"
              KeyPath="yes" />
      </Component>
    </ComponentGroup>

    <ComponentGroup Id="CustomFonts" Directory="FontsFolder">
      <Component Id="CMP_DigitalFont"
                 Guid="PUT-GUID-HERE">
          <File Id="digitalFont"
                Source="$(var.FontFolderPath)digital-7.ttf"
                TrueType="yes"
                KeyPath="yes" />
      </Component>
    </ComponentGroup>

    <Component Id="CMP_MenuShortcut"
               Directory="MyStartMenuShortcutDir"
               Guid="PUT-GUID-HERE">

      <Shortcut Id="MenuShortcut"
                Name="MyApp 1.0.0"
                Description="Lance le logiciel MyApp"
                Target="[APPLICATIONFOLDER]MyApp.exe"
                WorkingDirectory="APPLICATIONFOLDER"
                Icon="icon.ico"/>

      <RemoveFolder Id="RemoveMyStartMenuShortcutDir"
                    On="uninstall" />
      <RegistryValue Root="HKCU"
                    Key="SoftwareMyApp"
                    Name="installed"
                    Type="integer"
                    Value="2"
                    KeyPath="yes" />
    </Component>

    <Component Id="CMP_DesktopShortcut"
               Directory="DesktopFolder"
               Guid="PUT-GUID-HERE">
      <Shortcut Id="DesktopShortcut"
                Name="MyApp 1.0.0"
                Description="Lance le logiciel MyApp"
                Target="[APPLICATIONFOLDER]MyApp.exe"
                WorkingDirectory="APPLICATIONFOLDER"
                Icon="icon.ico"/>
      <RemoveFolder Id="DesktopFolder" On="uninstall"/>
      <RegistryValue
                 Root="HKCU"
                 Key="SoftwareMyApp"
                 Name="installed"
                 Type="integer"
                 Value="1"
                 KeyPath="yes"/>
    </Component>

  </Fragment>
</Wix>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After closely following Stein's guidelines on binary debugging (which took a little time to complete since it's my first time), I attached a box message to the execution sequence of my application (precisely in the constructor of the App class of my application WPF), then a break point directly on the instruction that follows the message box. I then generated the application, recreated the msi and then installed the msi. After launching the executable from the desktop shortcut, the message box appeared. I entered my source code before clicking on the OK button of the message box, I attached the process of my application (Debug -> Attach to process). The validation of the message box returned to me on Visual Studio, I was able to follow step by step the portion of the code until falling back on the small flat.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...