How to add custom message exit dialog to wix installer - c#

I want to add message to ExitDialog in wix installer. how can i do that?
I need to add message like this - Please restart you machine to make changes.
I have tried something like this.
<Feature Id="ProductFeature" Title="TFSServiceInstaller" Level="1">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="TFSShortcut" />
</Feature>
<UI>
<Property Id="WIXUI_INSTALLDIR" Value="TARGETDIR" />
<Property Id="WixUI_Mode" Value="Custom" />
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="EndDialog" Value="Return" Order="2"></Publish>
</UI>
<UIRef Id="WixUI_Common" />
only display that message would be enough for me. ( no need of check box)

for this need to add following property.
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Please Restart your Computer." />
then it will add text to exit screen. for more details see here

Use the REBOOT Property of WIX to restart prompt in the Product.wxs file of your Setup. Syntax is :-
<Property Id="REBOOT" Value="Force"></Property>

Related

Error 4: Could not load file or assembly 'MySql.Data.EntityFramework or one of its dependencies. The located assembly's definition does not match

I keep getting the error "Error 4: Could not load file or assembly 'MySql.Data.EntityFramework, Version=8.0.25.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" when trying to compile my csproj. Any help would be greatly appreciated
here is my ucsdb.edmx
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="ucsdbModel.Store" Provider="MySql.Data.MySqlClient"
ProviderManifestToken="5.6" Alias="Self"
xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator"
xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityType Name="Clan">
<Key>
<PropertyRef Name="ClanId" />
</Key>
<Property Name="ClanId" Type="bigint" Nullable="false" />
<Property Name="LastUpdateTime" Type="datetime" Precision="0" Nullable="false" />
<Property Name="Data" Type="text" Nullable="false" />
</EntityType>
<EntityType Name="Player">
<Key>
<PropertyRef Name="PlayerId" />
</Key>
<Property Name="PlayerId" Type="bigint" Nullable="false" />
<Property Name="Avatar" Type="text" Nullable="false" />
<Property Name="GameObjects" Type="text" Nullable="false" />
</EntityType>
<EntityContainer Name="ucsdbModelStoreContainer">
<EntitySet Name="Clan" EntityType="Self.Clan" Schema="ucsdb" store:Type="Tables" />
<EntitySet Name="Player" EntityType="Self.Player" Schema="ucsdb" store:Type="Tables" />
</EntityContainer>
</Schema>
</edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="ucsdbModel" Alias="Self" annotation:UseStrongSpatialTypes="false"
xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation"
xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityType Name="Clan">
<Key>
<PropertyRef Name="ClanId" />
</Key>
<Property Name="ClanId" Type="Int64" Nullable="false" />
<Property Name="LastUpdateTime" Type="DateTime" Nullable="false" />
<Property Name="Data" Type="String" Nullable="false" MaxLength="65535"
FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="Player">
<Key>
<PropertyRef Name="PlayerId" />
</Key>
<Property Name="PlayerId" Type="Int64" Nullable="false" />
<Property Name="Avatar" Type="String" Nullable="false" MaxLength="65535"
FixedLength="false" Unicode="false" />
<Property Name="GameObjects" Type="String" Nullable="false" MaxLength="65535"
FixedLength="false"
Unicode="false" />
</EntityType>
<EntityContainer Name="ucsdbEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Clan" EntityType="Self.Clan" />
<EntitySet Name="Player" EntityType="Self.Player" />
</EntityContainer>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S"
xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs
">
<EntityContainerMapping
StorageEntityContainer="ucsdbModelStoreContainer"
CdmEntityContainer="ucsdbEntities">
<EntitySetMapping Name="Clan">
<EntityTypeMapping TypeName="ucsdbModel.Clan">
<MappingFragment StoreEntitySet="Clan">
<ScalarProperty Name="ClanId"
ColumnName="ClanId" />
<ScalarProperty Name="LastUpdateTime"
ColumnName="LastUpdateTime" />
<ScalarProperty Name="Data"
ColumnName="Data" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Player">
<EntityTypeMapping
TypeName="ucsdbModel.Player">
<MappingFragment StoreEntitySet="Player">
<ScalarProperty Name="PlayerId"
ColumnName="PlayerId" />
<ScalarProperty Name="GameObjects"
ColumnName="GameObjects" />
<ScalarProperty Name="Avatar"
ColumnName="Avatar" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW
HERE) -->
<Designer
xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty
Name="MetadataArtifactProcessing"
Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild"
Value="true" />
<DesignerProperty Name="EnablePluralization"
Value="false" />
<DesignerProperty Name="IncludeForeignKeysInModel"
Value="false" />
<DesignerProperty Name="UseLegacyProvider"
Value="false" />
<DesignerProperty Name="CodeGenerationStrategy"
Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -
->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>
Need to use MySql.Data.EntityFramework.8.0.25, but the program does not have this dll file or use another version.
Click on the project's directory, right-click References and open Manage NuGet Packages.
Search for MySql.Data.EntityFramework to see Version. I hope I can help you.

WiX installer .msi doesn't install the attached .lib and .dll files

So I have a fully working Product.wxs file that installs a nifty Signature drawing program. I added a TestLibrary project with a TestClass with a very basic Add(int, int) method, and used it in my program just for testing purposes, then harvested the class' directory with heat (and ran it through and XSLT file for formatting), linked the Output.wxs to the project, referenced the ComponentGroup, and tried to install the whole thing together, hoping that the class would be installed along, and the software could run. This is not the case, it builds and installs flawlessly, just for the installed .exe to fail on launch.
Here's the Product.wxs:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="6daf7a49-43a8-403b-8d15-96197c8751cc" Name="SetupProject_Sig" Language="1033" Version="1.0.0.0" Manufacturer="VTC" UpgradeCode="f2ad826c-59b9-4f9f-af0d-8c9d80030605">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Condition Message="You need to be an administrator to install this product.">
Privileged
</Condition>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="SetupProject_Sig" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ComComponents" />
</Feature>
<Property Id="ApplicationFolderName" Value="Signature" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" />
<WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONFOLDER" Name="SetupProject_Sig" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<Feature Id="Complete" Title="Signature Tosz 1.0" Description="All files." Level="1" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
<Feature Id="MainProgram" Title="Program" Description="The main executable." Level="1">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="HelperLibrary" />
<ComponentRef Id="ProgramMenuDir" />
</Feature>
<Feature Id="Documentation" Title="Description" Description="Instruction manual." Level="1000">
<ComponentRef Id="Manual" />
<Condition Level="1">FILEEXISTS</Condition>
</Feature>
</Feature>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
<Component Id="ProductComponent" Guid="b3594fac-7524-4529-8874-5811705996b8">
<File Source="$(var.Control_Sig.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="RegistryComp">
<RegistryKey Id="ToszRegApplicationfolder" Root="HKLM" Key="Software\VTC\Tosz 1.0" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="APPLICATIONFOLDER" Value="[APPLICATIONFOLDER]" />
<RegistryValue Type="integer" Name="Flag" Value="0" />
</RegistryKey>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
The pre-build heat command:
call "%wix%\bin\heat.exe" dir "$(SolutionDir)\TestLibrary\bin\Debug" -var "var.TargetDir" -gg -g1 -srd -cg ComComponents -template fragment -out "$(ProjectDir)\Output.wxs" -v -t "$(ProjectDir)\bin\Debug\Filter.xslt"
Output.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR" />
</Fragment>
<Fragment>
<ComponentGroup Id="ComComponents">
<Component Id="cmp278E5D4E5835479434800F8B4056EB4B" Directory="TARGETDIR" Guid="A09371FD-ACE5-474E-B1B8-D9C83CF05497">
<Class Id="{DB173953-D21D-3F29-BC10-C6299EBD2BFF}" Context="InprocServer32" Description="TestLibrary.TestClass" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="TestLibrary.TestClass" Description="TestLibrary.TestClass" />
</Class>
<File Id="fil296E15219B07AF9559E0660E87293FC3" KeyPath="yes" Source="$(var.TargetDir)\TestLibrary.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32\1.0.0.0" Name="Class" Value="TestLibrary.TestClass" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32\1.0.0.0" Name="Assembly" Value="TestLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#fil296E15219B07AF9559E0660E87293FC3]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32" Name="Class" Value="TestLibrary.TestClass" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32" Name="Assembly" Value="TestLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{DB173953-D21D-3F29-BC10-C6299EBD2BFF}\InprocServer32" Name="CodeBase" Value="file:///[#fil296E15219B07AF9559E0660E87293FC3]" Type="string" Action="write" />
</Component>
<Component Id="cmp5BD81C93D46AA48BFAA1819DF54A67EB" Directory="TARGETDIR" Guid="86402057-DA0F-4B8E-BD0B-4973739A4008">
<File Id="fil108FAB265F126BACEED88B56AB065A99" KeyPath="yes" Source="$(var.TargetDir)\TestLibrary.tlb">
<TypeLib Id="{A9413C7C-F0C0-4DB1-82E3-116C411A0342}" Description="TestLibrary" HelpDirectory="TARGETDIR" Language="0" MajorVersion="1" MinorVersion="0">
<Interface Id="{A13FF8B0-AC7C-33E5-B0F3-5366304512AC}" Name="_TestClass" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
</TypeLib>
</File>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
The added line in Main() for testing:
System.Diagnostics.Debug.WriteLine(new TestLibrary.TestClass().Add(5, 3));
I've been trying to fix it for two days, and it's driving me nuts. Can't seem to figure out where it goes wrong, the Output looks perfect, the class should be getting installed, and yet the Signature program fails to launch.
Thanks in advance!
I don't have the intricate COM knowledge that Phil has so here's how I debug it.
Fire up a clean snapshotted VM.
Install your MSI.
Run a registry snapshot differencing tool such as InstallWatcher Pro.
Run regsvr32.exe your.dll
Take a another snapshot and compare.
Run your program to confirm regsvr32.exe fixed the problem. If not, look elsewhere for the source of your troubles.
Roll the VM snapshot back.
If so, analyze the differences and author it into your .wxs and rebuild. Rinse and repeat.

Entity - Schema Mapping and Namespaces

Added a Database and an Entity Model to my DAL Project.
got an error :
Error :
+ base {"Schema specified is not valid. Errors: \r\nMultiple types with the name 'TblRecord' exist in the EdmItemCollection in different namespaces. Convention based mapping requires unique names without regard to namespace in the EdmItemCollection."} System.Data.EntityException {System.Data.MetadataException}
The Edmx File
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="Xz.Business.Matches.Store" Alias="Self" Provider="System.Data.SqlServerCe.4.0" ProviderManifestToken="4.0" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityContainer Name="XzBusinessMatchesStoreContainer">
<EntitySet Name="Records" EntityType="Xz.Business.Matches.Store.Records" store:Type="Tables" />
</EntityContainer>
<EntityType Name="Records">
<Key>
<PropertyRef Name="Record" />
</Key>
<Property Name="Record" Type="nvarchar" Nullable="false" MaxLength="100" />
<Property Name="Relations" Type="nvarchar" MaxLength="450" />
</EntityType>
</Schema>
</edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="Xz.Business.Matches" Alias="Self" p1:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:p1="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="RecordzEntities" p1:LazyLoadingEnabled="true">
<EntitySet Name="Records" EntityType="Xz.Business.Matches.TblRecord" />
</EntityContainer>
<EntityType Name="TblRecord">
<Key>
<PropertyRef Name="Record" />
</Key>
<Property Name="Record" Type="String" Nullable="false" MaxLength="100" Unicode="true" FixedLength="false" />
<Property Name="Relations" Type="String" MaxLength="450" Unicode="true" FixedLength="false" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="XzBusinessMatchesStoreContainer" CdmEntityContainer="RecordzEntities">
<EntitySetMapping Name="Records">
<EntityTypeMapping TypeName="Xz.Business.Matches.TblRecord">
<MappingFragment StoreEntitySet="Records">
<ScalarProperty Name="Record" ColumnName="Record" />
<ScalarProperty Name="Relations" ColumnName="Relations" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="True" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="True" />
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>
Names & Namespaces :
Project Name : Business.Matches
Default Namespace : Xz.Business.Matches
I added an Entity Model with this definitions :
Model : RecordzModel
Context : RecordzContext
Model Namespace : Xz.Business.Matches
You seem to have more than one class in your project that is called 'TblRecord'. Namespaces are ignored when matching your types to EDM types for POCO types and therefore if you have more than one class with the same name it is ambiguous and causes the exception.

Install features based on checkboxes

I am trying to make it so that when the user selects something via check box, a corresponding feature will be installed.
I am aware of the prebuilt feature tree that Wix provides but there are some other things that I am doing that do not allow me to use this function. I am curious as to how to link the two together so that when the user selects the check box "Install Feature X", feature X is installed when the user clicks the install button.
I found what it was that solves my issue. To do as I had intended, I needed to create a checkbox for each feature as so.
<Control Id="FeatureX" Type="CheckBox" X="191" Y="50" Width="140" Height="17"
Property="FEATUREX_CHECKED" CheckBoxValue="myValue" Text="Install feature X" />
<Control Id="FeatureY" Type="CheckBox" X="191" Y="67" Width="140" Height="17"
Property="FEATUREY_CHECKED" CheckBoxValue="myValue" Text="Install feature Y" />
<Control Id="FeatureZ" Type="CheckBox" X="191" Y="84" Width="140" Height="17"
Property="FEATUREZ_CHECKED" CheckBoxValue="myValue" Text="Install feature Z" />
Now once I did that I then added a corresponding publish to each, and made a condition that made it so that only if the check box is selected will that feature be installed. Like so:
<Control Id="Next" Type="PushButton" Text="Next" X="254" Y="243" Height="17" Width="56">
<Publish Event="Remove" Value="ALL" Order="1">1</Publish>
<Publish Event="AddLocal" Value="FeatureX" Order="2">
<![CDATA[FEATUREX_CHECKED]]>
</Publish>
</Control>
NOTE:
Remove is used to deselect everything from being installed (It was brought to my attention that once the UI is invoked, it is too late to change feature levels).
Then each feature is checked to see if the "corresponding checkbox" has been selected and if so adds it to the "AddLocal" Property. AddLocal would look like this if one were to look at it:
ADDLOCAL=FeatureX, FeatureY, FeatureZ...
The final thing I needed to do to get this to work was too check in my main.wxs to make sure that the FeatureID used in the checkboxes matched up with the ComponentGroupRefID used:
<ComponentGroupRef Id="FeatureX"/>
So there it is...
I again, thank everyone for their help with this. If anyone reading this is confused by anything, please feel free to drop me a line, and I will do my best to explain things a little bit further.
This is my sample code for installing features
Product.wxs
<Product Id="{C9FD5DDE-2625-4E01-B415-8A734464F341}"
Name="!(wix.Product)" Language="1033" Version="1.0.0.0"
Manufacturer="!(wix.Manufacturer)" UpgradeCode="!(wix.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" Languages="1033"
Manufacturer="!(wix.Manufacturer)" Description="!(wix.ProductDesc)"/>
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<WixVariable Id="UpgradeCode" Value="{E5695E2A-EE5F-4EEE-A326-98A9F8B2EF0A}"/>
<WixVariable Id="Manufacturer" Value="BSDreams"/>
<WixVariable Id="Product" Value="WixSubFeatures"/>
<WixVariable Id="ProductDesc" Value="Minimal select one feature install"/>
<WixVariable Id="ProductIcon" Value="chk_on.ico"/>
<WixVariable Id="WixSubFiles" Value=".\Files"/>
<Property Id="ARPNOMODIFY" Value="0" />
<Property Id="ARPPRODUCTICON" Value="!(wix.ProductIcon)" />
<Property Id="INSTALLDIR">
<RegistrySearch Id="WixSubFeaturesSearch" Type="raw" Root="HKCU"
Key="!(wix.Manufacturer)\!(wix.Product)" Name="InstallDir" />
</Property>
<Icon Id="chk_on.ico" SourceFile="!(wix.WixSubFiles)\!(wix.ProductIcon)"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ManufacturerDir" Name="!(wix.Manufacturer)">
<Directory Id="INSTALLDIR" Name="!(wix.Product)">
<Component Id="ProductMain" Guid="{FF35C142-480A-4d67-A2ED-E5C9E508F809}">
<CreateFolder />
<RegistryKey Id="WixSubDirReg" Root="HKCU" Key="!(wix.Manufacturer)\!(wix.Product)" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="[INSTALLDIR]" Action="write"/>
</RegistryKey>
</Component>
</Directory>
</Directory>
</Directory>
<UIRef Id="UserInterface"/>
<Feature Id="PRODUCTFEATURE" Title="!(wix.Product)" Level="1" >
<ComponentRef Id="ProductMain"/>
<ComponentRef Id="IconFile"/>
<Feature Id="OPTIONA" Title="Option A" Level="1" >
<ComponentRef Id="TestFileA"/>
</Feature>
<Feature Id="OPTIONB" Title="Option B" Level="3" >
<ComponentRef Id="TestFileB"/>
</Feature>
<Feature Id="OPTIONC" Title="Option C" Level="3" >
<ComponentRef Id="TestFileC"/>
</Feature>
</Feature>
<DirectoryRef Id="INSTALLDIR">
<Component Id="IconFile" Guid="{967A5110-B0F8-47b0-967B-CC4624D06EA5}">
<File Id="IconFileA" Source="!(wix.WixSubFiles)\!(wix.ProductIcon)" Name="chk_on.ico" Vital="yes" />
</Component>
<Component Id="TestFileA" Guid="{F5ACE3D7-03DE-47a7-9CE8-50CEF5E9A7BF}">
<File Id="SomeFileA" Source="!(wix.WixSubFiles)\SomeFileA.txt" Name="BSDA.txt" Vital="yes"/>
</Component>
<Component Id="TestFileB" Guid="{CB5D53FB-8CED-42ef-89FF-08C7709CFCA5}">
<File Id="SomeFileB" Source="!(wix.WixSubFiles)\SomeFileB.txt" Name="BSDB.txt" Vital="yes" />
</Component>
<Component Id="TestFileC" Guid="{987EA193-A1E0-41d2-8E9D-87D30D8F03AD}">
<File Id="SomeFileC" Source="!(wix.WixSubFiles)\SomeFileC.txt" Name="BSDC.txt" Vital="yes" />
</Component>
</DirectoryRef>
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
<InstallExecuteSequence>
<Custom Action="SetARPINSTALLLOCATION" After="InstallValidate"></Custom>
</InstallExecuteSequence>
</Product>
UserInterface.wxs
<Fragment Id="WixSubUI">
<UI Id="UserInterface">
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Property Id="WixUI_Mode" Value="Custom" />
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="FatalError" />
<DialogRef Id="UserExit" />
<DialogRef Id="InstallDirDlg"/>
<DialogRef Id="FeaturesDlg" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="2"></Publish>
<Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="FeaturesDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="ExitDialog" Order="2">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
</UI>
<UIRef Id="WixUI_Common" />
This will give you a basic installer that installs base on the selected features checkbox UI
The advice for check boxes is eerily similar to that for radio buttons. Use AddLocal and Remove control events on the Next or Install button, each of which condition against the property tied to your check boxes. It's too late to use feature install levels by the time you're showing UI to the user.

Update Model from Database breaks when there is a View in my Model

One of my Entity Framework Models contains a MS-SQL View. The View is called User and contains various properties for users.
When I right click on the model and select Update Model from Database, I get the following error:
"An exception of type 'System.InvalidOperationException' occurred while attempting to update from the database. The exception message is: 'A model generation extension made changes to the model generated from the database that were not valid'.
This occurs in any model we have that uses a View in Entity Framework 4.0. It's getting very tedious to delete and recreate the model every time some part of the database structure changes. Is there anyway to make "Update Model from Database" work when my model contains a View?
If it makes a difference, this is a readonly View.
EDIT: I forgot to mention, this is a cross-database View. That seems to be where the problem occurs. A regular view (within the same database) works fine.
Here's a my sample EDMX file. I'm not sure if it will be useful or not.
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
<edmx:Runtime>
<edmx:StorageModels>
<Schema Namespace="SignupsModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
<EntityContainer Name="SignupsModelStoreContainer">
<EntitySet Name="Users" EntityType="SignupsModel.Store.Users" store:Type="Views" Schema="dbo">
</EntitySet>
</EntityContainer>
<EntityType Name="Users">
<Key>
<PropertyRef Name="userID" />
</Key>
<Property Name="userID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="userName" Type="varchar" Nullable="false" MaxLength="50" />
<Property Name="campusID" Type="varchar" Nullable="false" MaxLength="7" />
<Property Name="firstName" Type="varchar" Nullable="false" MaxLength="30" />
<Property Name="middleInitial" Type="varchar" Nullable="false" MaxLength="1" />
<Property Name="lastName" Type="varchar" Nullable="false" MaxLength="30" />
</EntityType>
</Schema>
</edmx:StorageModels>
<edmx:ConceptualModels>
<Schema Namespace="SignupsModel" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityContainer Name="Entities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Users" EntityType="SignupsModel.User" />
</EntityContainer>
<EntityType Name="User">
<Key>
<PropertyRef Name="userID" />
</Key>
<Property Name="userID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="userName" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
<Property Name="campusID" Type="String" Nullable="false" MaxLength="7" Unicode="false" FixedLength="false" />
<Property Name="firstName" Type="String" Nullable="false" MaxLength="30" Unicode="false" FixedLength="false" />
<Property Name="middleInitial" Type="String" Nullable="false" MaxLength="1" Unicode="false" FixedLength="false" />
<Property Name="lastName" Type="String" Nullable="false" MaxLength="30" Unicode="false" FixedLength="false" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs">
<EntityContainerMapping StorageEntityContainer="SignupsModelStoreContainer" CdmEntityContainer="Entities">
<EntitySetMapping Name="Users"><EntityTypeMapping TypeName="SignupsModel.User"><MappingFragment StoreEntitySet="Users">
<ScalarProperty Name="userID" ColumnName="userID" />
<ScalarProperty Name="userName" ColumnName="userName" />
<ScalarProperty Name="campusID" ColumnName="campusID" />
<ScalarProperty Name="firstName" ColumnName="firstName" />
<ScalarProperty Name="middleInitial" ColumnName="middleInitial" />
<ScalarProperty Name="lastName" ColumnName="lastName" />
</MappingFragment></EntityTypeMapping></EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
I think I tracked down the issue. A while back, I guess I installed a Visual Studio addon called "Edmx Views Processor". I thought I had uninstalled it. Removing the addon seems to solve the issue.
The extension in question is located here:
http://visualstudiogallery.msdn.microsoft.com/en-us/d9b76b5d-d45c-4e79-8d28-31444be582de

Categories

Resources