I'm trying to disable registry reflection in WiX.
Because I want to write in Key="Software\\[Manufacturer]\\[ProductName]", regardless of platform. When I install my app on x64 platform, installer replace key "Software\Wow6432Node\\[Manufacturer]\\[ProductName]"
When I set DisableRegistryReflection="yes" attribute, installer still write to "Software\Wow6432Node\\[Manufacturer]\\[ProductName]".
<Component DisableRegistryReflection="yes" Id="SampleID">
<RegistryKey Root="HKLM" Key="Software\[Manufacturer]\[Product Name]" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="[UpdaterLocation]" Name="RootFolder"/>
</RegistryKey>
</Component>
To write in that portion of the registry you must mark you component as 64-bit Win64="yes"
It's imposible, becouse I have clearly 32 bit component.
Related
I need to create a download URL in wix burn based on the user inputs to download a MSI package. I am setting the properties as below and properties set into those variable without a problem when I give them as inputs while creating the .exe package.
<Variable Name="PROTOCOL" Value="!(wix.Protocol)" bal:Overridable="yes"/>
<Variable Name="SOURCE" Value="!(wix.Source)" bal:Overridable="yes"/>
But the problem is when I use these properties inside the downloadUrl attribute of the MsiPackage element actual values of the properties will not be taken. Burn just recognize them as [PROTOCOL] and [SOURCE]. Following is my MsiPackage element.
<MsiPackage Id="SSCE" Name="SQL Server Compact Edition" SourceFile="../PackageRepo/SQLCE 3.5/SSCERuntime-ENU.msi" Cache="no" Vital="yes" Compressed="no" ForcePerMachine="yes" Permanent="yes"
DownloadUrl="[PROTOCOL]://[SOURCE]/PackageRepo/SQLCE 3.5/SSCERuntime-ENU.msi" InstallCondition="(NOT SSCERuntimeVersion) AND (NOT SSCERuntimeServicePackLevel)"/>
Because of this file is not downloading.
So can anyone please tell me how to use the property values inside the MsiPackage element's downloadUrl attribute.
I wrote a Boostrapper UI in C# for Net Framework 2.0 using Win-Forms. It started working fine and designed forms are responding as expected.
Here is my Wix Bundle Code:
<?define TargetFile=$(var.MyBA.TargetDir)$(var.MyBA.TargetFileName)?>
<?define BootstrapConfigFile=$(var.MyBA.ProjectDir)BootstrapperCore.config?>
<Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Farrukh" UpgradeCode="54c4a4a4-dca8-4ae4-b2f4-5e3f3fd8cb92">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<Payload SourceFile="$(var.BootstrapConfigFile)"/>
<Payload SourceFile="$(var.TargetFile)"/>
<Payload SourceFile="$(env.WIX)\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
<Chain>
<!--<PackageGroupRef Id='Netfx4Full' />-->
<MsiPackage Id="MyInstaller"
Cache="no"
Visible="yes"
DisplayInternalUI="yes"
SourceFile="MyProduct.msi"
/>
</Chain>
</Bundle>
As you can see that it doesn't include NetFX package and as it requires Net-Framework 2.0, I experimented with renaming the Net Framework registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup-Renamed
and 32 bit
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup-Renamed
so that it won't be able to detect it. This resulted in displaying a very basic UI: i.e.
I believe , this was displayed due to following markups in my Bundle, but I'm not sure about that
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
However, when I clicked "Accept and Install" nothing happened and buttons just got disappeared. That may be because I added no NetFx Package, neither any reference to WixNetFxExtension. (And I will definitely gonna add these and will see results later).
Question: I want to edit this basic UI so if my user try to install it on Windows XP (with no Net Framework), he/she would get the UI as I will design, not this basic one. So how can I edit this basic UI?
I feel, I'm missing some basic thing here, but need some guidance.. would really appreciate any help/guidance.
Regards
I was able to solve this after finding a thread on Wix User's mailing list. Here it is:
customizing burn prerequisite boostrapper image in theme
So this screen is known as Burn Prerequisite and it has a special WixVariable ID. Here is code from my Bootstrapper, depicting the use of my own custom theme for Burn's pre-req screen:
<WixVariable Id="PreqbaThemeXml" Value="..\resources\MbaPrereqTheme.xml" />
<WixVariable Id="PreqbaThemeWxl" Value="..\resources\MbaPrereqTheme.wxl" />
And any resources like Logo.png, Banner.bmp and NetfxLicense.rtf etc which you have referenced in MbaPrereqTheme.xml, would have to be part of Bootstrapper as a PayLoad:
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
<Payload SourceFile="$(var.BootstrapConfigFile)"/>
<Payload SourceFile="$(var.MyBootstrapDll)"/>
<Payload SourceFile="$(env.WIX)\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
<!-- Following are required as payload and to be used by Pre-Req screen.-->
<Payload SourceFile="..\resources\logo.png"/>
<Payload SourceFile="..\resources\Banner.bmp"/>
<Payload SourceFile="..\resources\NetfxLicense.rtf"/>
</BootstrapperApplicationRef>
And this started working just like as I wished :).
Regards
I am creating a custom bootstrapper which has a WPF UI.
First: the WPF user interface will display.
Second: when I click the install button, the MsiPackage will execute, the internal UI will display because I set DisplayInternalUI to yes
Everything is OK, but it has a problem. The internal UI displays behind the custom WPF UI.
How do I set the internal UI to display at the top of window?
I tried to minimize the WPF UI when I click the Install button. Yes, the WPF UI will minimized, and seconds later the internal UI also... It shows with the minimized window state too.
My bundle.wxs:
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<PayloadGroupRef Id="InstallerPayload"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="NetFx40Full"/>
<PackageGroupRef Id="InstallerPackages"></PackageGroupRef>
</Chain>
</Bundle>
<Fragment>
<PayloadGroup Id="InstallerPayload">
<Payload SourceFile="..\CustomBootstrapper\bin\release\MahApps.Metro.dll"/>
<Payload SourceFile="..\CustomBootstrapper\bin\release\System.Windows.Interactivity.dll"/>
<Payload SourceFile ="..\CustomBootstrapper\bin\release\CustomBootstrapper.dll"/>
<Payload SourceFile="..\CustomBootstrapper\BootstrapperCore.config" />
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.7\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</PayloadGroup>
</Fragment>
<Fragment>
<PackageGroup Id="InstallerPackages">
<!-- <MsiPackage Id="CRMInstall"
Vital="yes"
Name="Packages\SetupProject1.msi"
SourceFile="Packages\SetupProject1.msi"
DisplayInternalUI="yes"> -->
<MsiPackage Id="CRMInstall"
Vital="yes"
Name="Packages\StandardSetup.msi"
SourceFile="..\StandardSetup\bin\Release\StandardSetup.msi"
DisplayInternalUI="yes">
</MsiPackage>
</PackageGroup>
</Fragment>
..
..
When you call Engine.Apply() make sure you pass the handle to the WPF Window that is being displayed. It should go something like:
var mainWindowHandle= new WindowInteropHelper(mainWindow).EnsureHandle();
Engine.Apply(mainWindowHandle);
Where mainWindow is class that inherits from the WPF Window class.
I have seen How do you create an event log source using WiX. My question is what is the common use (scenario) of specifying Event Source in Wix? I was thinking that specifying the source would list your application's install/uninstall process under that source in the event log so it would be easy to filter/check but even after doing that the source shows up as MsiInstaller for me. What am I doing wrong or am I misunderstanding the use of util:EventSource?
Here is my code :
<Component Id="EventLogSettings" Guid="A456420B-21E7-4306-904E-5CD3822193F0">
<util:EventSource Log="Application" Name="WixSample" SupportsErrors ="yes" SupportsInformationals ="yes" SupportsWarnings ="yes" EventMessageFile="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll" KeyPath="yes"/>
<!--<?if $(var.Platform) = x64 ?>
<util:EventSource Log="Application" Name="WixSample" EventMessageFile="[NETFRAMEWORK20INSTALLROOTDIR64]EventLogMessages.dll" KeyPath="yes" />
<?else ?>
<util:EventSource Log="Application" Name="WixSample" EventMessageFile="[NETFRAMEWORK20INSTALLROOTDIR]EventLogMessages.dll" KeyPath="yes" />
<?endif ?>-->
</Component>
As you can see I tried two options. Each of them creates a registry entry in the Computer\HKLM\SYSTEM\CurrentControlSet\services\eventlog\Application\WixSample but I am not sure if I need to reference the WixNetFxExtension. If I do then what about installation of non .net application? What do I do in those cases?
You are misunderstanding EventSource. EventSource is used to create a custom source for your application to use in it's logging to the windows event log.
You will always see the install/uninstall of your application show up as MsiInstaller.
What is the WiX 'KeyPath' attribute? In particular, how does it apply to the following:
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\CompName\AppName"
Type="string" Value="" KeyPath="yes" />
</Component>
As explained by Rob Mensching:
The KeyPath for a Component is a
single resource that the Windows
Installer uses to determine if a
Component "exists" on a machine.
This means that when Windows Installer decides whether to install your component, it will first look whether the keypath resource is already present. If it is, none of the resources in the component are installed.
The presence of the keypath resource also determines whether a component has been damaged or has gone missing when you "repair" an MSI.
When the keypath resource is a versioned file, Windows Installer will consider it to exist only if it finds a file with an equal or higher version.
In your specific example, you have a component which removes a folder on uninstallation. This component will only be installed if the given registry key does not yet exists. Adding a registry key to use as the key path is a common trick when you need a keypath for a component that installs resources that cannot be used as a keypath themselves, like a shortcut.