wpf app msi created by wix not working due to dependency issue? - wpf

Here is my solution.
I have a basic wpf application which uses cefsharp to show google.com. The app works fine when run from my bin folder in VisualStudio itself.
For this application I have created the following WiX file:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define WpfApplication6_TargetDir=$(var.WpfApplication6.TargetDir)?>
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="acv" UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject1" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SetupProject1" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<Component Id="WpfApplication6.exe" Guid="*">
<File Id="WpfApplication6.exe" Name="WpfApplication6.exe" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe" />
</Component>
<Component Id="WpfApplication6.exe.config" Guid="*">
<File Id="WpfApplication6.exe.config" Name="WpfApplication6.exe.config" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe.config" />
</Component>
<Component Id="CefSharp.WinForms.dll" Guid="*">
<File Id="CefSharp.WinForms.dll" Name="CefSharp.WinForms.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.WinForms.dll" />
</Component>
<Component Id="CefSharp.dll" Guid="*">
<File Id="CefSharp.dll" Name="CefSharp.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.dll" />
</Component>
<Component Id="CefSharp.Core.dll" Guid="*">
<File Id="CefSharp.Core.dll" Name="CefSharp.Core.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.Core.dll" />
</Component>
</ComponentGroup>
</Fragment>
This code creates the setup, and when the application runs after installing the following exception occurs: Could not find cefsharp.core or one of its dependencies is not loaded.
This error appears when Visual c++ is not present.
How do I fix this, as I have Visual c++ installed.
Should I add any references in my WiX file?

Related

Referenced assembly FSharp.Data.SqlProvider.dll has assembly level attribute but no public type provider classes were found

How to make SQLProvider work in F#? I followed their steps but had few errors.
I run PM> Install-Package SQLProvider
Create a new .fsx script file
Load the dll #r #"C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll"
At that stage, I have this warning:
Referenced assembly
'C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll'
has assembly level attribute
'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute'
but no public type provider classes were found
If I continue and try to run the example script, it can't recongnised SqlDataProvider:
#r #"C:\src\FSharpDB\DBTest\packages\SQLProvider.1.2.10\lib\net472\FSharp.Data.SqlProvider.dll"
open FSharp.Data.Sql
type Sql = SqlDataProvider<
Common.DatabaseProviderTypes.MSSQLSERVER,
"Server=myServer;Database=myDB;Trusted_Connection=True;">
Error:
The type 'SqlDataProvider' is not defined.
Am I missing anything?
Edit:
As asked in the comments below, more information on the project configuration
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core" version="6.0.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="SQLProvider" version="1.2.10" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net48" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
<package id="System.Runtime" version="4.3.1" targetFramework="net48" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net48" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>

Android Build keep failing with build hint telephony

I want to make the App work only for Android phones and not on tablets so I tried to add the following build hint telephony() to make the App work on Phone for Android under xpermissions:
""
I'm attaching the generated XML with telephony hint added twice one with false(default) and duplicate added with true(added by me).I'm not sure where is the option to replace the default build hint which added with false value. I'm suspecting that was causing the issue for build to fail on the server.
Please find the generated log below:
<receiver android:name="com.codename1.impl.android.LocalNotificationPublisher" ></receiver>
<service android:name="com.codename1.impl.android.BackgroundFetchHandler" android:exported="false" />
<activity android:name="com.codename1.impl.android.CodenameOneBackgroundFetchActivity" android:theme="#android:style/Theme.NoDisplay" />
<activity android:name="com.codename1.location.CodenameOneBackgroundLocationActivity" android:theme="#android:style/Theme.NoDisplay" />
<service android:name="com.codename1.location.BackgroundLocationHandler" android:exported="false" />
<service android:name="com.codename1.location.GeofenceHandler" android:exported="false" />
<service android:name="com.codename1.media.AudioService" android:exported="false" /> </application>
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-feature android:name="android.hardware.telephony"/></manifest>
You shouldn't include a manifest entry that's already included. We always mark dependencies as required false. That means the permission is desired but that the app will not fail if the permission is revoked. That's generally good practice as the true flag for required is probably a mistake especially in a cross platform application.

Directory xx is in the user profile but is not listed in the RemoveFile table

When iam trying to create the installer i am getting the following error:
Error Message:
ICE64: The directory ProgramMenuServersFolder is in the user profile but is not listed in the RemoveFile table. C:\Documents and Settings\admin\Desktop\SetupProject1\SetupProject1\Product.wxs 74 1 SetupProject1.
How to Proceed further?
<!--Start C2 by Me, ProgramMenuFolder is used to add shortcut on start menu -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuLightRidgeFolder" Name="LightRidge Resources">
<Directory Id="ProgramMenuAdminFolder" Name="Admin"/>
<Directory Id="ProgramMenuServersFolder" Name="Servers">
<!--<Directory Id="ServersHisSubFolder" Name="Historian Server" />
<Directory Id="ServersMsgSubFolder" Name="Messaging Server" />-->
<Directory Id="ProgramMenuServersHisSubFolder" Name="Historian Server" />
<Directory Id="ProgramMenuServersMsgSubFolder" Name="Messaging Server" />
</Directory>
<Directory Id="ProgramMenuUtilitiesFolder" Name="Utilities"/>
</Directory>
</Directory>
<!--End C2 by Me -->
<Directory Id="DesktopFolder" Name="Desktop">
<Component Id="DesktopShortcut" Guid="{484EA493-A1E0-41d2-8E5D-67D30D8F03AD}">
<RegistryKey Root="HKCU" Key="Software\LightRidge Resources\PE-Advisor">
<RegistryValue Name="DesktopShortcutPe-Advisor" Value="1" Type="integer" KeyPath="yes" Action="write"/>
</RegistryKey>
<Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="PE-Advisor" ShortName="PEAdv" Target="[PEADVISOR]Symcon.LightRidge.PEAdvisor.exe" Icon="GRAPH03.ICO"/>
</Component>
</Directory>
</Directory>
<!-- close tag of main directory-->
<UIRef Id="UserInterface"/>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<!-- <ComponentRef Id="WFTest.exe" /> -->
<ComponentRef Id="ProductMain"/>
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="ApplicationHelpShortcut"/>
<ComponentRef Id="UtilitiesApplicationShortcut"/>
<ComponentRef Id="DesktopShortcut" />
<ComponentRef Id="UTILITIES" />
<ComponentRef Id="HISTORIAN" />
<ComponentRef Id="ADMIN" />
<ComponentGroupRef Id="PEAdvisorFiles"/>
<ComponentGroupRef Id="Historian"/>
<ComponentGroupRef Id="ConfigFiles"/>
<ComponentGroupRef Id="Help"/>
<ComponentRef Id="AdminApplicationShortcut"/>
<ComponentRef Id="HistorianApplicationShortcut"/>
<ComponentRef Id="MESSAGING"/>
<ComponentRef Id="MessagingApplicationShortcut"/>
<!--<ComponentRef Id="ServerApplicationShortCut"/>-->
</Feature>
<!-- Start C3 Me, Component Group of 'config' files -->
<ComponentGroup Id="ConfigFiles" Directory="CONFIG">
<Component Id="ColorSchemes" Guid="*">
<File Id="ColorSchemes" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\ColorSchemes.xml" Name="ColorSchemes.xml" Vital="yes"/>
</Component>
<Component Id="config" Guid="*">
<File Id="config" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\config.xml" Name="config.xml" Vital="yes"/>
</Component>
<Component Id="HelpConfig" Guid="*">
<File Id="HelpConfig" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\HelpConfig.xml" Name="HelpConfig.xml" Vital="yes"/>
</Component>
<Component Id="PIConfig" Guid="*">
<File Id="PIConfig" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\PIConfig.xml" Name="PIConfig.xml" Vital="yes"/>
</Component>
<Component Id="ReportServerConfig" Guid="*">
<File Id="ReportServerConfig" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\ReportServerConfig.xml" Name="ReportServerConfig.xml" Vital="yes"/>
</Component>
<Component Id="OptionsConfig" Guid="*">
<File Id="OptionsConfig" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\options.xml" Name="Options.xml" Vital="yes"/>
</Component>
<Component Id="version" Guid="*">
<File Id="version" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\ExternalLib\config\version.xml" Name="version.xml" Vital="yes"/>
</Component>
</ComponentGroup>
<DirectoryRef Id ="ProgramMenuServersHisSubFolder">
<Component Id="HistorianApplicationShortcut" Guid="{484EA493-A1E0-41d2-8E5D-87D30D8F03AD}">
<Condition>HISTORIAN</Condition>
<Shortcut Id="HistorianStartMenuShortcut" Name="Historian Server"
Description="Historian Server"
Target="[HISTORIANSERVER]HistorianServer.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY" Icon="GRAPH03.ICO"/>
<RemoveFolder Id="ProgramMenuServersHisSubFolder" On="uninstall"/>
<!--<RemoveFolder Id='RemoveProgramMenuServersFolder' Directory='ProgramMenuFolder' On='uninstall'/>-->
<!--<RemoveFolder Id="ProgramMenuServersFolder" On="uninstall" />-->
<!--<RemoveFolder Id="ProgramMenuServersFolder" On="uninstall"/>-->
<!--<RemoveFolder Id="ProgramMenuServersHisSubFolder" On="uninstall"/>-->
<!--<RemoveFolder Id="Servers" On="uninstall"/>-->
<RegistryValue Root="HKCU" Key="Software\LightRidge Resources\PE-Advisor" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<ComponentGroup Id="Messaging" Directory="MESSAGINGSERVER">
<Component Id="MESSAGING" Guid="{980EA493-A1E6-41d2-8E5D-87D30D8F03AD}">
<Condition>MESSAGING</Condition>
<File Id="Server" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\MessagingSystem\ExternalLib\Server.exe" Name="Server.exe" Vital="yes"/>
<File Id="ServerConfig.xml" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\MessagingSystem\ExternalLib\ServerConfig.xml" Name="ServerConfig.xml" Vital="yes"/>
<File Id="ServerComponentMessaging" Source="D:\PE-Advisor Source code 4-26 11-July-2012 (Dowloaded from FTP site on19-Oct-12)\08 DesktopApplication\MessagingSystem\ExternalLib\ServerComponent.dll" Name="ServerComponent.dll" Vital="yes"/>
<!--<RemoveFolder Id="ProgramMenuServersMsgSubFolder" On="uninstall"/>-->
<!--<RegistryValue Root="HKCU" Key="Software\LightRidge Resources\PE-Advisor" Name="installed" Type="integer" Value="1" KeyPath="yes"/>-->
</Component>
</ComponentGroup>
<DirectoryRef Id ="ProgramMenuServersMsgSubFolder">
<Component Id="MessagingApplicationShortcut" Guid="{980EA493-A8E6-41d2-8E5D-67D30D8F03AD}">
<Condition>MESSAGING</Condition>
<Shortcut Id="MessagingStartMenuShortcut" Name="Messaging Server"
Description="Messaging Server"
Target="[MESSAGINGSERVER]Server.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY" Icon="GRAPH03.ICO"/>
<RemoveFolder Id="ProgramMenuServersMsgSubFolder" On="uninstall"/>
<!--<RemoveFolder Id="ProgramMenuServersFolder" On="uninstall"/>-->
<!--<RemoveFolder Id="Servers" On="uninstall"/>-->
<RegistryValue Root="HKCU" Key="Software\LightRidge Resources\PE-Advisor" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
Please see another question with a solution to this: Directory xx is in the user profile but is not listed in the RemoveFile table.
Regards
Liam

Wix installer error code 2343 received for a simple configuration. (WIX Newbie)

I am receiving the following error when using the following simple WIX configuration. The application being installed is WPF.
Product: Web Miner Installer -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2343. The arguments are: , ,
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Application Title" Language="1033" Version="1.0.0.0" Manufacturer="Avant Prime" UpgradeCode="855a8b6e-c576-41e2-8118-8f3511613478">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="Application Title" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<DirectoryRef Id="ShortcutFolder">
<Component Id="ShortcutsComponent" Feature="ProductFeature" Guid="{B40F2C3F-CACC-4196-8F8F-C0F6B082404E}">
<CreateFolder Directory="ShortcutFolder" />
<RemoveFolder Id="RemoveShorcutFolder" Directory="ShortcutFolder" On="uninstall" />
<Shortcut Id="UninstallProduct"
Name="Uninstall xxxxxxx"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]"
Directory="ShortcutFolder"
Description="Uninstalls xxxxxxx"/>
<RegistryValue Id="RegistryShortcut"
Root="HKCU"
Key="SOFTWARE\xxxxxx\settings"
Name="Shortcut"
Value="1"
Type="integer"
KeyPath="yes" />
</Component>
</DirectoryRef>
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This setup requires the .NET Framework 4.5.1 to be installed.">
Installed OR NETFRAMEWORK45
</Condition>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Directory Id="ShortcutFolder" Name="xxxxxx"></Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="xxxxxxx" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.MyApplication.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
What am I missing or doing wrong?
Here is the requested log information. It is big so I attached a link.
WIX Installer Error Log
You should replace INSTALLLOCATION with the real property (INSTALLFOLDER in your case)

Log4net not printing to console in wpf

I have a WPF application with 2 log4net appenders in log4net, the first printing to file and the second should print to console.
For some reason I am not being able to show the result on log4net, but I do see it in the file. What is wrong?
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\\Temp\\1.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="Header" value="[Header]\r\n" />
<param name="Footer" value="[Footer]\r\n" />
<param name="ConversionPattern" value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Do you see a console pop up when you start the application.
It could be you have to configure your application as a console project to have a console window...
Otherwise you can check trace info. Normally an appender tries to leave one error message there if he can't log to the desired location.
Output window of visual studio catches trace messages when debugging...
Possible duplicate: Log4net won't log to console (WinForms app)
If you are wanting to see the messages in the output window in visual studio you should use the following instead:
<appender name="TraceAppender" type="log4net.Appender.TraceAppender" >
Do you call once XmlConfigurator.Configure() ?

Resources