Wix Burn Bootstrapper Uninstalling Crystal Report on Major Upgrade - crystal-reports

I am using wix burn for my bootstrapper and every time I have upgrade to my application Crystal Reports runtime gets uninstalled. Can someone please help me fix this?
Bundle.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include Variables.wxi ?>
<Bundle Name="!(loc.BundleName)"
Version="$(var.Version)"
Manufacturer="!(loc.Manufacturer)"
HelpTelephone="!(loc.HelpPhone)"
Copyright="!(loc.Copyright)"
UpgradeCode="$(var.UpgradeCode)"
IconSourceFile="$(var.MainApplicationImagesFolder)\Car_Count_Report_Flat.ico" >
<!--SplashScreenSourceFile="$(var.MainApplicationImagesFolder)\BurnSplashScreen.bmp" >-->
<bal:Condition Message="This install requires Windows 7 Service Pack 1 or Higher">
((VersionNT >= v6.1) AND (ServicePackLevel >= 1) OR (VersionNT >= v6.3))
</bal:Condition>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<WixVariable Id="WixStdbaLicenseRtf" Value="$(var.EULAFolder)\EULA_en-US.rtf" />
<WixVariable Id="WixStdbaLogo" Value="$(var.MainApplicationImagesFolder)\car_counter_report_icon_64.png" />
<!-- Checks the Crystal Reports Registry Values -->
<!--<util:RegistrySearch Root="HKLM" Key="SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports"
Value="CRRuntime64Version" Format="raw" Variable="CRRuntime64Version" Result="value" Win64="yes"/>-->
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports"
Value="CRRuntime32Version" Format="raw" Variable="CRRuntime32Version" Result="value"/>
<!-- Checks the Main Application Registry Values -->
<!--<util:RegistrySearch Root="HKLM" Key="Software\Saunders Creative Strategies\Kaady\Car Count Report"
Value="Version" Format="raw" Variable="x64Version" Result="value" Win64="yes"/>-->
<util:RegistrySearch Root="HKLM" Key="Software\Saunders Creative Strategies\Kaady\Car Count Report"
Value="Version" Format="raw" Variable="x86Version" Result="value"/>
<!-- Adds Local Variables -->
<Variable Name="CRRUNTIMEUPGRADE" bal:Overridable="yes" Type="numeric" Value="1" />
<Chain>
<!-- TODO: Define the list of chained packages. -->
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
<PackageGroupRef Id="NetFx45Redist"/>
<PackageGroupRef Id ="CrystalReportsRuntime"/>
<PackageGroupRef Id="MainApplicationFile"/>
</Chain>
</Bundle>
</Wix>
InstallationFiles.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include Variables.wxi ?>
<Fragment>
<!-- Crystal Reports Runtime -->
<PackageGroup Id="CrystalReportsRuntime">
<!--<?if $(var.Platform) = x64 ?>--><!--
--><!--<MsiPackage Id ="CRRuntime64"
DownloadUrl="$(var.CRHttp)/$(var.CRx64Msi)"
SourceFile="$(var.3rdPartyApplicationFiles)\$(var.CRx64Msi)"
Name="$(var.CRx64Msi)"
Vital ="yes"
Compressed="no"
ForcePerMachine="yes"
InstallCondition="NOT CRRuntime64Version OR (CRRuntime64Version < "$(var.CRVersion)")" >
<MsiProperty Name="UPGRADE" Value="[CRRUNTIMEUPGRADE]" />
</MsiPackage>--><!--
--><!--<?else ?>-->
<MsiPackage Id ="CRRuntime32"
DownloadUrl="$(var.CRHttp)/$(var.CRx86Msi)"
SourceFile="$(var.3rdPartyApplicationFiles)\$(var.CRx86Msi)"
Name="$(var.CRx86Msi)"
Vital ="yes"
Compressed="no"
ForcePerMachine="yes"
Visible="yes"
Permanent="yes"
InstallCondition="NOT CRRuntime32Version AND (NOT (CRRuntime32Version = "$(var.CRVersion)"))" >
<MsiProperty Name="UPGRADE" Value="[CRRUNTIMEUPGRADE]" />
</MsiPackage>
<!--<?endif ?>-->
</PackageGroup>
<PackageGroup Id="MainApplicationFile">
<!--<MsiPackage Id="MainApplicationx64Msi" Vital="yes" Compressed="yes" ForcePerMachine="yes" Cache="yes"
Name="$(var.Mainx64Msi)"
InstallCondition="NOT x64Version OR (x64Version < "$(var.Version)")"
SourceFile="$(var.MainApplicationx64MsiFile)\$(var.Mainx64Msi)"/>-->
<MsiPackage Id="MainApplicationx86Msi" Vital="yes" Compressed="yes" ForcePerMachine="yes" Cache="yes"
Name="$(var.Mainx86Msi)"
Visible="no"
InstallCondition="NOT x86Version OR (x86Version < "$(var.Version)")"
SourceFile="$(var.MainApplicationx86MsiFile)\$(var.Mainx86Msi)"/>
</PackageGroup>
</Fragment>
</Wix>
Thank you
Shane

If you look at the install log in the user's temp directory, you would see that the upgrade bundle doesn't think it should install the CRRuntime32 because the InstallCondition is false. Burn uses the MSI's upgrade table to do the same logic that you're trying to do. If the Crystal Reports MSI is authored correctly, you should be able to just drop your install condition and let Burn decide whether it needs to be installed.

You should use DetectCondition instead of InstallCondition. The first answers: Is it installed?; The second: For a bundle installation, is it wanted?
The way you have it, burn removes CR when it is present during installation because the logic says it's not wanted.

Related

[Wix][PostgreSQL] How to add an install condition in bundle

I'm trying to add a condition before installing PostgreSQL on Wix bundle.
I'm expecting it to check if there is an installed version of PostgreSQL as you can see on my following code:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="Title" Version="1.0.0.0" Manufacturer="Manufacture" UpgradeCode="5aee5af2-10c7-42d1-bde6-c7dadf736786">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
<?define InstallPgCommand=--unattendedmodeui minimal --mode unattended --superpassword "super_pwd" --servicename "service_name" --servicepassword "service_pwd" --serverport 5433?>
<Chain>
<!-- Install postgres -->
<ExePackage
SourceFile="ThirdPartyApps\postgresql-14.3-1-windows-x64.exe"
Compressed ="yes"
Vital ="yes"
Permanent ="yes"
InstallCommand="$(var.InstallPgCommand)"
InstallCondition="NOT POSTGRESINSTALLED"
/>
</Chain>
</Bundle>
<Fragment>
<Property Id="POSTGRESINSTALLED">
<RegistrySearch Id="POSTGRESINSTALLED_SEARCH" Key="SOFTWARE\PostgreSQL\Installations\postgresql-x64-14" Root="HKLM" Type="raw" Name="Branding" />
</Property>
</Fragment>
</Wix>
But it didn't work as expect.
Can you tell me what I'm doing wrong ? Thanks everyone
RegistrySearch is for MSI packages. For bundles, use util:RegistrySearch instead.

Error: Need to specify the physical directory for the virtual path 'Web/' of role

I'm following the answer at the bottom of this question here: ASP.NET 5 web application as Azure Web Role? as I am trying to build an azure web role for asp.net core.
When I run the powershell script I get the error:
Error CloudServices077: Need to specify the physical directory for the virtual path 'Web/' of role
If anyone knows another way to use azure web roles in asp.net core then I am all for that too.
I'm using CSPack to try and configure this.
Powershell Script:
# path to cspack
$cspackPath = Join-Path $env:ProgramFiles 'Microsoft SDKs\Azure\.NET SDK\v2.8\bin\cspack.exe'
$PackagePath = 'I:\Users\MyUserName\Documents\visual studio 2015\Projects\SoundVast\SoundVast.Azure\SoundVast.cspkg'
$serviceDefinitionFile = 'I:\Users\MyUserName\Documents\visual studio 2015\Projects\SoundVast\SoundVast.Azure\ServiceDefinition.csdef'
$webRoleName = 'WebRole1'
$webRolePath = 'I:\Users\MyUserName\Documents\visual studio 2015\Projects\SoundVast\SoundVast.Azure'
# define the cspack parameters
$cspackParameter = #(
$serviceDefinitionFile,
"/role:$webRoleName;$webRolePath;",
"/sites:$webRoleName;SoundVast;$webRolePath",
"/out:$PackagePath"
)
# execute cspack
& $cspackPath #cspackParameter
ServiceDefinition.csdef
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SoundVast.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WebRole name="WebRole1" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
</WebRole>
</ServiceDefinition>
ServiceConfiguration.Cloud & ServiceConfiguration.Local
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="SoundVast.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
<Role name="WebRole1">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
Folder structure (if it makes a difference...)
I was missing the phsycial directory on this line: <Site name="Web" physicalDirectory="../SoundVast">. After this I ran the script and it created a package for me. The documentation on this is really not good.
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SoundVast.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WebRole name="WebRole1" vmsize="Small">
<Sites>
<Site name="Web" physicalDirectory="../SoundVast">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
</WebRole>
</ServiceDefinition>
I encountered this issue and resolved it by deleting the web role from my cloud service (it was an MVC) and generating a new one. I had made so many modifications it had become messy, so making a new one from scratch solved the issue

WiX Bootstrapper: How do I set burn variables from the command line?

Using WiX 3.7 and .NET 4.0.
How does one set burn variables when running a WiX bootstrapper EXE from the command line?
First of all, the burn variables that you wish to set need to be set as Overridable. To do this you must include the follow namespace in your WXS: xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" and if you're using Visual Studio like me you need to include WixBalExtension.dll in your project references. Next you need to add the following attribute to all of the burn variables that you want to set via the command line: bal:Overridable="yes".
Now you can set the variables via the command line in this fashion:
BootstrapperSetup.exe /i /passive MyBurnVariable1=1 MyBurnVariable2=2
Below is an example of a WXS file that satifies all of the conditions described above:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="MyProduct" Version="1.0.0" Manufacturer="MyManufacturer" UpgradeCode="PUT-UPGRADE-CODE-HERE">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl="MyLicense.htm" ThemeFile="MyThemeFile.xml" LocalizationFile="MyLocFile.wxl" />
</BootstrapperApplicationRef>
<Variable Name="MyBurnVariable1" bal:Overridable="yes" Type="numeric" Value="0" />
<Variable Name="MyBurnVariable2" bal:Overridable="yes" Type="numeric" Value="0" />
<Chain>
<MsiPackage Id="MyFirstMsiPackage"
SourceFile="first.msi"
InstallCondition="MyBurnVariable1 = 1" />
<MsiPackage Id="MySecondMsiPackage"
SourceFile="second.msi">
<MsiProperty Name="MY_PROPERTY" Value="[MyBurnVariable2]" />
</MsiPackage>
</Chain>
</Bundle>
</Wix>

x64 Word 2010 Add In registration using WiX

I' deploying a Word Add in using WiX, regarding x84 target Platforms (at least the Office installation has to be x86, never the less which OS Platform is used) everything is working well, my COM Interop registration of the Word Add In works and the add in auto-starts the first time I start word afer I installed the Add In.
I'm doing following registration stuff to the registry (cut from output of heat.exe)
I've created an intermediate file, helping me out for the COM Interop registration using this heat command:
"C:\Program Files\Windows Installer XML v3.5\bin\heat.exe" file MyAddin.dll -ag -template fragment -out MyAddin.wxs
The output of interesst looks like: (I know using RegistryValue this way has been deprecated)
<Class Id="{10BC65F1-32C0-3ED4-98A0-17661A8C4455}" Context="InprocServer32" Description="MyAddin.MyAddinClass" ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="MyAddin.MyAddinClass" Description="MyAddin.MyAddinClass" />
</Class>
<File Id="filCC4172BEC1312562EDEF49648E45AE0D" KeyPath="yes" Source="..\MyAddin\bin\Debug\MyAddin.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="Class" Value="MyAddin.MyAddinClass" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="Assembly" Value="MyAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#filCC4172BEC1312562EDEF49648E45AE0D]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="Class" Value="MyAddin.MyAddinClass" Type="string"Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="Assembly" Value="MyAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{10BC65F1-32C0-3ED4-98A0-17661A8C4455}\InprocServer32" Name="CodeBase" Value="file:///[#filCC4172BEC1312562EDEF49648E45AE0D]" Type="string" Action="write" />
The component including this stuff has the Win64Flag tag set to yes. Therefore I thought things will be written to the x64 part of the registry. Until this, i read following article about registry reflection telling this:
For example, the 32-bit InprocServer32 key is not relevant for 64-bit applications, so the InprocServer32 key is not reflected to the 64-bit registry view.
Furthermore:
However, 64-bit applications can use the 32-bit LocalServer32 key and the LocalServer32 key gets reflected.
But I already tried to use LocalServer32 instead of InprocServer32, but doing this, won't let my add in start on both platforms.
Will I have to use a call to RegAsm Tool or I'm missing a some tag or Interop registration option for x64 Platforms? Can anybody help?
With wix you need to do two things to disable registry reflection:
Mark your component as 64 bit component (attribute Win64="yes") (as you did)
Build your package as 64 bit package (Platform = x64)
This package won't be usable on x86 systems. So you will need two packages, one for x86 and one for x64. You can use the same source file for both packages as the Win64 attribute is ignored by the x86 package.

SYmfony plugin upload error: You must specify the min version for symfony

I have been trying to upload my SYmfony plugin for some time but I keep getting this error.
Initially the dependency on the SYmfony Package was missing, but I added that.
My package.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>sfActivateablePlugin</name>
<channel>pear.symfony-project.com</channel>
<summary>sfActivateablePlugin allows auditing record activation/deactivation by setting up a flag, timestamp & user detail fields.</summary>
<description>The sfActivateablePlugin allows you to automatically:
* create a `is_active` flag (or name of your choice)
* create timestamp & user detail fields (e.g. `activated_by`, `activated_at`, ...)
* populate timestamps & user details when `is_active` flag is toggled on a record.</description>
<lead>
<name>Prasad Gupte</name>
<user>prasadgupte</user>
<email>xxxxxxxx#gmail.com</email>
<active>yes</active>
</lead>
<date>2010-09-22</date>
<time>19:33:09</time>
<version>
<release>1.0.0</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.symfony-project.com/license">MIT license</license>
<notes>
* First public release.
</notes>
<contents>
<dir baseinstalldir="sfActivateablePlugin/" name="/">
<file baseinstalldir="sfActivateablePlugin/" md5sum="89b09d4d48e5259a3c659dfc65b0fc52" name="config/plugin_settings.yml.sample" role="data" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="8b40522acb23552e6e31ba2416387515" name="lib/Activateable.class.php" role="php" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="926a9eb938eccc9083d2b116e50246b3" name="lib/Listener/Activateable.class.php" role="php" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="17346d33da2ea3b9d880afc71e7022fd" name="LICENSE" role="doc" />
<file baseinstalldir="sfActivateablePlugin/" md5sum="b836dfd2f324ae4ea975842197dcf8e2" name="README" role="doc" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.2.6</min>
</php>
<pearinstaller>
<min>1.4.1</min>
</pearinstaller>
<package>
<name>Symfony</name>
<channel>pear.symfony-project.org</channel>
<min>1.4</min>
<recommended>1.4</recommended>
</package>
</required>
</dependencies>
<phprelease />
<changelog>
<release>
<version>
<release>1.0.0</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2010-09-22</date>
<license uri="http://www.symfony-project.com/license">MIT license</license>
<notes>
* First public release.
</notes>
</release>
</changelog>
</package>
Am I missing some tag? Or specified incorrect Symfony version? Pl help
Figured out a couple of mistakes:
1. the package name is symfony and not Symfony
2. the max version is also required
If you use the Pear Package Manager API:
$packagexml->addPackageDepWithChannel('required', 'symfony', 'pear.symfony-project.com', '1.4', '1.4', '1.4');