I have created a .wixproj installer for my WPF program which successfully installs my WPF application. I now want to add the installation of a device driver as part of this installation as this device is required for using certain parts of the WPF app. However, having included the driver files in their own component and using the DIFX Driver tag, the installer project can be built but the installation fails when it gets to the DIFX component.
I have one file, Drivers.wxs, where I create the components and use the DIFXAPP Driver tag:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns=http://schemas.microsoft.com/wix/2006/wi
xmlns:difx=http://schemas.microsoft.com/wix/DifxAppExtension>
<Fragment>
<ComponentGroup Id="Drivers">
<ComponentRef Id="cyusb"/>
</ComponentGroup>
<DirectoryRef Id="INSTALLFOLDER" FileSource="..\Installer\drivers">
<Directory Id='DriverFolder' Name='Drivers'>
<Directory Id='CYUSBFolder' Name='CyUSB'>
<Component Id="cyusb" Guid="{6125BDA1-74B9-443C-B130-494C60367EA4}">
<File Id="cyusb.sys" Name="CyUSBsys" Vital="yes" Source=".\drivers\cyusb\cyusb3.sys" KeyPath="yes" />
<File Id="cyusb.cat" Name="CyUSBcat" Vital="yes" Source=".\drivers\cyusb\cy_devices.cat" />
<File Id="cyusb.inf" Name="CyUSBinf" Vital="yes" Source=".\drivers\cyusb\Cy_Devices.inf" />
<difx:Driver Legacy="yes"/>
</Component>
</Directory>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
Then I reference this component group in my Product.wxs within the product tag alongside all my other features:
<!--Define components, shortcuts, files etc for installer-->
<Feature Id="ProductFeature" Title="AnalytacleClientInstaller" Level="1">
<ComponentGroupRef Id="Drivers"/>
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="CompiledComponents"/>
<ComponentGroupRef Id="FileTypeComponents"/>
</Feature>
I have also added the DifxAppExtension as a reference for my project and added the Difx library reference within the .wixProj file itself :
<WixLibrary Include="difxapp_x64.wixlib">
<HintPath>difxapp_x64.wixlib</HintPath>
<Name>difxapp_x64.wixlib</Name>
</WixLibrary>
There are no errors or warnings and I am able to build my installer just fine, but when I run the install it fails with the same error message each time, here is a snippet from the log where DIFXAPP starts:
DIFXAPP: ENTER: InstallDriverPackages()
DIFXAPP: INFO: 'CustomActionData' property 'DIFxApp Version' is '2.1'.
DIFXAPP: INFO: 'CustomActionData' property 'UI Level' is '2'.
DIFXAPP: INFO: 'CustomActionData' property 'componentId' is '{6125BDA1-74B9-443C-B130-494C60367EA4}'.
DIFXAPP: INFO: 'CustomActionData' property 'componentPath' is 'C:\Program Files (x86)\MyProj\Drivers\CyUSB\'.
DIFXAPP: INFO: 'CustomActionData' property 'flags' is 0x8.
DIFXAPP: INFO: 'CustomActionData' property 'installState' is '2'.
DIFXAPP: INFO: 'CustomActionData' property 'ProductName' is 'MyProj'.
DIFXAPP: INFO: 'CustomActionData' property 'ManufacturerName' is 'manufacturer'.
DIFXAPP: INFO: user SID of user performing the install is 'S-1-5-21-1332366759-4080576608-3295227165-1001'.
DIFXAPP: INFO: opening HKEY_USERS\S-1-5-21-1332366759-4080576608-3295227165-1001\Software\Microsoft\Windows\CurrentVersion\DIFxApp\Components\{6125BDA1-74B9-443C-B130-494C60367EA4} (User's SID: 'S-1-5-21-1332366759-4080576608-3295227165-1001') ...
DIFXAPP: ERROR: no driver packages found in C:\Program Files (x86)\MyProj\Drivers\CyUSB\
DIFXAPP: ERROR: InstallDriverPackages failed with error 0x2
DIFXAPP: RETURN: InstallDriverPackages() 2 (0x2)
CustomAction MsiInstallDrivers returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
If I remove the <difx:Driver> tag then installation completes successfully and the .inf, .cat and .sys files all appear in C:\Program Files (x86)\MyProj\Drivers\CyUSB\ where DIFX is looking for them. I’ve not installed drivers before with WiX Toolset, please let me know what I’ve missed or if I should be taking a different approach entirely!
Thanks very much for any help
I'm trying to create a setup file (MSI) that runs without admin privileges. for that, I've tried the bellow option.
I've set InstallAlluser property to false as bellow.
Also set InstallAllUsersVisible to false
I've also changed Default location with [AppDataFolder]
After changes above properties It still required Administrator permission to execute MSI file that created using Setup project.
Can you please help me to resolve this issue.
Thanks in Advance.
When you open your MSI with Orca (or equivalent MSI viewer), do you see the "UAC Compliant" check box checked? Sample screenshot here:
You should really use a more flexible and capable MSI tool than the Visual Studio Installer projects. They are good for a few purposes, but lack flexibility and there are numerous other problems: summary of VS Project problems (short form).
Per-User setups considered harmful: Some words of warning against per user setups. Here is one more answer on that.
A simple per-user folder installation in WiX (insert UPPERCASE GUIDs in locations shown with "PUT-GUID-HERE" (2 occurrences) - you can use this GUID generator):
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="PerUserSample" Language="1033" Version="1.0.0.0" Manufacturer="-" UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<UIRef Id="WixUI_Mondo" />
<Feature Id="ProductFeature" Title="PerUserSample" Level="1" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="AppDataFolder">
<Directory Id="Something" Name="Something">
<Component Feature="ProductFeature" Guid="PUT-GUID-HERE">
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\Test"
Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<File Source="C:\Windows\Notepad.exe" />
<RemoveFolder Id="Something" Directory="Something" On="uninstall" />
</Component>
</Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PerUserSample" />
</Directory>
</Directory>
</Product>
</Wix>
I'm trying to install a database with WIX.
I've already installed SQL Server 2008 express on my Windows7 (32 Bit). On this installation, TCP/IP is enabled, SQL Server service is running.
I'm using SQL Server and Windows authentication for SQL Server. I tried both in the code - I added a user in the component.
The code is very basic :
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
<Product Id="*" Name="NewDatabaseInstaller" Language="1033"
Version="1.0.0.0" Manufacturer="My Company"
UpgradeCode="17ef693b-3ab5-4788-a6b5-70eeabc13497">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="NewDatabaseInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="NewDatabaseInstaller" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="cmpSqlDatabase" Guid="{F950605D-AA59-43E6-AB19-9452F6BEC649}" KeyPath="yes">
<sql:SqlDatabase Id="sqlDatabase_MyDatabase" Server="localhost"
Instance="MSSQLSERVER" Database="MyDatabase"
CreateOnInstall="yes" DropOnUninstall="yes"
ContinueOnError="no" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
I had the instance name by taping this query in the Management studio :
SELECT ##servicename
However, I get an error :
CreateDatabase: Error 0x80004005: failed to create to database: 'MyDatabase', error: unknown error
Error 26201. Error -2147467259: failed to create SQL database: MyDatabase, error detail: unknown error.
MSI (s) (FC!74) [17:43:27:786]: Product: Test -- Error 26201. Error -2147467259: failed to create SQL database: MyDatabase, error detail: unknown error.
CustomAction CreateDatabase returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 17:43:27: InstallFinalize. Return value 3.
Did I miss something?
Thanks !
I found my problem.
I'm ashamed of my error : I put a instance
Instance="MSSQLSERVER"
I did not need it. I thought it was the
SELECT ##servicename
So, I don't know when we need it... Did someone know?
Thanks Yan for your help!
While upgrading our production server to ubuntu 14 the solr/jetty broke.
To fix i tried:
- upgraded java version to 8.
- upgraded solr to 5.3
My earlier config used .war files. realized that now its stopped supporting .war files, so now cannot use my earlier config.
This was the steps i used earlier:
copy the solr.war file from the downloaded and untarred solr to the webapps folder, and make jetty owner:
sudo cp ~/x/apache-solr-3.6.1/dist/apache-solr-3.6.1.war /usr/share/jetty/webapps/solr.war
sudo chown jetty:jetty /usr/share/jetty/webapps/solr.war
create a context file in JETTY_HOME/contexts (sudo vim /usr/share/jetty/contexts/solr.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<!-- Set the solr.solr.home system property -->
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call name="setProperty" class="java.lang.System">
<Arg type="String">solr.solr.home</Arg>
<Arg type="String">/usr/share/solr</Arg>
</Call>
</Configure>
tell solr how many cores we have and what those are in SOLR_HOME (sudo vim /usr/share/solr/solr.xml):
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="demo" instanceDir="demo" />
<core name="dev" instanceDir="dev" />
<core name="qa" instanceDir="qa" />
<core name="www" instanceDir="www" />
</cores>
</solr>
etc.
Don't want to use the solr instance that comes with rsolr (4), if i can help it. But can't find corresponding info for solr 5.3
Running rails 3.2.21. and solr_sunspot gem 2.2.0
Thanks in advance!
I have a problem where I compiled my application on Visual Studio 2010 while targetting the .NET Framework 3.5, deployed it to a client server, only to find it gives me the following error:
************** Exception Text **************
System.MissingMethodException: Method not found: 'Void
System.Xml.Xsl.XslCompiledTransform.Transform(
System.Xml.XPath.IXPathNavigable,
System.Xml.Xsl.XsltArgumentList,
System.Xml.XmlWriter,
System.Xml.XmlResolver)'.
************** Loaded Assemblies **************
[...]
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
The method it says it's looking for is this: XslTransform.Transform Method (IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver) (Supported in: 4, 3.5, 3.0, 2.0, 1.1)
I've tried setting up a redirect to the .NET Framework 4.0 version of the same DLL using the assemblyBinding element like so:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0"
newVersion="4.0.0.0"/>
<codeBase version="4.0.0.0"
href="file:///C:/WINDOWS/Microsoft.NET/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
But now the application won't run, and puts this in the event log:
EventType clr20r3, P1
myapplication.exe, P2 3.85.12.27583,
P3 4be9757f, P4 system.configuration,
P5 2.0.0.0, P6 4889de74, P7 1a6, P8
136, P9
ioibmurhynrxkw0zxkyrvfn0boyyufow, P10
NIL.
So, in summary, (1) does anyone know why the application can't find the method listed, and (2) why doesn't it let me redirect to the .NET 4.0 version of System.Xml?
Any help is appreciated, I'm totally stuck!
app.config as requested:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="myapplication.Properties.UserSettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<system.net>
<mailSettings>
<smtp from="e-monitoring#myapplication.co.uk">
<network defaultCredentials="true" host="192.168.0.132" port="25" password="" userName="" />
</smtp>
</mailSettings>
</system.net>
<appSettings file="">
<add key="ReportDataCollectionTimeout" value="360" />
<add key="AllowedDatabaseBuild" value="3" />
<add key="AllowedDatabaseRevision" value="085" />
<add key="HelpNamespace" value="myapplicationHelpfile.chm" />
<add key="ProFormaHomePageUri" value="https://myapplication.co.uk/" />
<add key="ProFormaLoginPageUri" value="https://myapplication.co.uk/login.aspx" />
</appSettings>
<connectionStrings configSource="connectionStrings.config" />
<userSettings>
<myapplication.Properties.UserSettings>
<setting name="RequiresUpgrade" serializeAs="String">
<value>True</value>
</setting>
</myapplication.Properties.UserSettings>
</userSettings>
</configuration>
If you are targeting .NET 3.5 why are you doing a binding redirect to System.Xml v4.0.0.0? Make sure that your project references v2.0.0.0 of that assembly and that you have the following in your app.config:
<startup><supportedRuntime version="v2.0.50727"/></startup>
Also make sure that you are targeting .NET Framework 3.5 and not .NET Framework 3.5 Client Profile. Finally make sure the client has .NET 3.5 installed.
I've solved the problem by using this Transform method instead of the previous one (where I was previously passing null into the XmlResolver argument at the end).
Strange how this worked on my development and test machine, and not the server.
Try looking into the file version for System.XML.dll in the assembly folder. chances are that the last bit of the file on your system are different then the ones on server. in your case "2.0.50727.3082" does not seem to have the specified method signature. The version on the development machine was "2.0.50727.8009" which did have the required method signature.
EDIT: Decided to use the XMLReader version of the method. Even though we could register the newer version in the GAC(which did'nt give runtime error) from our local machine and that removed the error. but since the .NET could upgrade to a newer version and overwrite GAC we would need to be careful that the newer version would not have same problem.