Unable to Uninstall WiX Managed Bootstrapper application from another Managed Bootstrapper Application - c#

I have my own Managed Bootstrapper Application developed using WiX Toolset and written in c# using MVVM pattern. As this is a Managed Bootstrapper Application, i have a custom UI as well. My Bundle.wxs Code is as follows
<Bundle Name="NestleMESSetup"
Version="!(bind.packageVersion.NestleCustomLayerSetupPackage)"
Manufacturer="CT Infotech"
UpgradeCode="CCBB8D5B-8171-47FB-AD53-25C6E866C34E"
Copyright="Copyright© 2017 CT Infotech ALL RIGHTS RESERVED"
SplashScreenSourceFile="Resources\Splash.bmp"
IconSourceFile="Resources\menu.ico">
<Variable Name="KambanVersion" Type="version" Value="!(bind.packageVersion.KambanFASSetup)"/>
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<PayloadGroupRef Id="InstallerPayload"/>
</BootstrapperApplicationRef>
<util:RegistrySearchRef Id='SearchForKamban' />
<Chain>
<PackageGroupRef Id="InstallerPackages"/>
</Chain>
<Variable Name="DbName" bal:Overridable="yes" />
<Variable Name="SqlInstance" bal:Overridable="yes" />
<Variable Name="InstallPath" bal:Overridable="yes" />
<Variable Name="Roles" bal:Overridable="yes" />
<Variable Name="Modules" bal:Overridable="yes" />
<Variable Name="CustomInstall" bal:Overridable="yes"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
</Bundle>
<Fragment>
<PayloadGroup Id="InstallerPayload">
<Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\BootstrapperCore.config"/>
<Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\bin\$(var.Configuration)\Nestle.MES.Bootstrapper.UI.dll"/>
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</PayloadGroup>
</Fragment>
<Fragment>
<PackageGroup Id="InstallerPackages">
<RollbackBoundary Id="StartingPoint" Vital="yes" />
<ExePackage Id="KambanFASSetup" Cache="no" Compressed="yes" Vital="yes" Permanent="no" Name="KambanCoreSetup"
SourceFile="..\..\Kamban.FAS.Setup_Source\$(var.Configuration)\KambanFASSetup.exe" >
<CommandLine InstallArgument="[SqlInstance]" Condition="1" />
<CommandLine InstallArgument="[DbName]" Condition="1"/>
<CommandLine InstallArgument="[InstallPath]" Condition="1"/>
<CommandLine InstallArgument="[Roles]" Condition="1"/>
<CommandLine InstallArgument="[Modules]" Condition="1" />
<CommandLine InstallArgument="[CustomInstall]" Condition="1"/>
</ExePackage>
<MsiPackage SourceFile="..\..\build_folder\$(var.Configuration)\Nestle.MES.CustomLayer\Nestle.MES.CustomLayerSetup.msi"
Id="NestleCustomLayerSetupPackage" Cache="yes" Visible="no" Compressed="yes" EnableFeatureSelection="yes" Vital="yes">
<MsiProperty Name="INSTALLFOLDER" Value="[INSTALLFOLDER]" />
<MsiProperty Name="VERSION" Value="[VERSION]"/>
<MsiProperty Name="ADDLOCAL" Value="[NestleFeatures]" />
</MsiPackage>
</PackageGroup>
</Fragment>
<Fragment>
<util:RegistrySearch
Id='SearchForKamban'
Variable="KambanInstalled"
Result="exists"
Root="HKLM"
Key="SOFTWARE\Wow6432Node\KambanFAS" />
<bal:Condition Message="Product already Exists">
KambanInstalled
</bal:Condition>
</Fragment>
In the above code, you can see that I have an MsiPackage and an ExePackage in my Bundle chain. The ExePackage with Id="KambanFASSetup" is also a Managed Bootstrapper Application with its very own custom UI. Once I install this Parent bundle exe, i get two entries in my Programs and Features. I believe this is because i have two managed bootstrapper exe. So now while uninstalling the NestleMESSetup only my MsiPackage is getting uninstaled and my ExePackage doesnt. But my requirement is as follows
The ExePackage should also be uninstalled if I uninstall the Parent Exe.
The Uninstallation of the Child ExePackage must happen silently. i.e
It's UI should NOT be shown prompting the user to click the Uninstall
button again.
Please let me know if more info is needed.Any help on this would be much appreciated.
Edit1:
Here is the Uninstall logs in %temp% folder
[2658:3330][2017-05-19T19:27:11]i001: Burn v3.10.2.2516, Windows v6.1 (Build 7601: Service Pack 1), path: C:\ProgramData\Package Cache\{a21ebf3e-08b2-4b64-b5bf-38dccfea21a2}\Nestle.MES.Setup.exe
[2658:3330][2017-05-19T19:27:11]i000: Initializing version variable 'KambanVersion' to value '1.0.647.0'
[2658:3330][2017-05-19T19:27:11]i009: Command Line: '/uninstall'
[2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\RAJASA~1.000\AppData\Local\Temp\NestleMESSetup_20170519192711.log'
[2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleManufacturer' to value 'CT Infotech'
[2658:3330][2017-05-19T19:27:11]i000: Loading managed bootstrapper application.
[2658:3330][2017-05-19T19:27:11]i000: Creating BA thread to run asynchronously.
[2658:3330][2017-05-19T19:27:11]i100: Detect begin, 2 packages
[2658:3330][2017-05-19T19:27:11]i000: Setting numeric variable 'KambanInstalled' to value 1
[2658:3330][2017-05-19T19:27:11]i101: Detected package: KambanFASSetup, state: Absent, cached: None
[2658:3330][2017-05-19T19:27:11]i101: Detected package: NestleCustomLayerSetupPackage, state: Present, cached: Complete
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: AppFeatures, state: Local
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: WebFeatures, state: Local
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: DbFeatures, state: Local
Edit2:
With the Detect Condition added to my Bundle chain Exe package I am not able to Uninstall the Parent exe as well. The WiX logs are as follows
[1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: Active, restart initiated: No, disable resume: No
[1644:0F04][2017-05-20T07:33:59]w341: Prompt for source of container: WixAttachedContainer, path: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe
[1644:0F04][2017-05-20T07:33:59]e054: Failed to resolve source for file: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe, error: 0x80070002.
[1644:0F04][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while prompting for source (original path 'E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe'). [1644:0F04][2017-05-20T07:33:59]e311: Failed to acquire container: WixAttachedContainer to working path: C:\Users\RAJASA~1.000\AppData\Local\Temp\{B5BE6652-F453-40B5-A2BF-6313B191EA7F}\9FD1B9E707102B3EB2E75EA87962C5C839E9588A, error: 0x80070002.
[1644:1B24][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while caching, aborting execution.
[1450:1BBC][2017-05-20T07:33:59]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart: None, disable resume: No
[1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart initiated: No, disable resume: No
[1644:1B24][2017-05-20T07:33:59]i399: Apply complete, result: 0x80070002, restart: None, ba requested restart: No
[1644:1B24][2017-05-20T07:33:59]i500: Shutting down, exit code: 0x0

Your ExePackage is missing the UninstallCommand attribute so burn does not know how to properly uninstall it. It should be something like
UninstallCommand="/uninstall /quiet"
and may be some additions if needed.
And for burn to be able to detect the ExePackage, it should define the attribute DetectCondition. Something like
DetectCondition="KambanInstalled"

Related

How to execute Custom action in Wix after Uninstall completed

I have enabled logging using below code :
<Property Id="MsiLogging" Value="voicewarmupx!"/>
and I want to copy log file from temp folder to custom Log location.
I have written a custom action as below
<CustomAction Id="CopyLogFile" Execute="immediate"
ExeCommand="cmd /c copy [MsiLogFileLocation] [LogsFolder]"
Directory="TARGETDIR"
Impersonate="no"
Return="asyncNoWait" />
<InstallExecuteSequence>
Custom Action="CopyLogFile" OnExit="success"></Custom>
After successful installation above code works fine but when I do Uninstall the code is not working.
Any one please help me to move file from Temp folder to specific folder after uninstall.?
The specify the condition for the Custom Action to be invoked on an uninstall: (REMOVE="ALL") AND NOT UPGRADINGPRODUCTCODE.
This should work:
<CustomAction Id="CopyLogFile" Execute="immediate"
ExeCommand="cmd /c copy [MsiLogFileLocation] [LogsFolder]"
Directory="TARGETDIR"
Impersonate="no"
Return="asyncNoWait" />
<InstallExecuteSequence>
<Custom Action="CopyLogFile" OnExit="success">(REMOVE="ALL") AND NOT UPGRADINGPRODUCTCODE</Custom>
...
See the full property references you can use in the Microsoft Docs.

npm-tfs-unlock package on TFS

I have a problem with a npm package the tfs-unlock (I'm using grunt)
This is the message that I get from server when trying to build.
[exec] [4mRunning "tfs-unlock:checkout" (tfs-unlock) task[24m
[exec] [31m>> [39mChild process exited with code # 1.
[exec] [33mWarning: Task "tfs-unlock:checkout" failed. Use --force to continue.[39m
[exec]
[exec] [31mAborted due to warnings.[39m
and this is the configuration of the task
'tfs-unlock': {
'checkout': {
'options': {
'tfsPath': ["vs2013", "bit64"],
'action': 'checkout'
},
'files': {
'src': ['js/*.js', 'js/*.min.js', 'css/*.css']
}
}
}
Has anyone who used it, have had this issue? if so, why this error appears? how to make it work?
Thank you
PS: locally works perfect, it does not complain of anything.
I'm using Jenkins and Octopus for automatic build and deploy.
When Jenkins builds, changes should be applied (this is the step where the "tfs-unlock:checkout" fails says that the "checkout child" does not exist, when clearly it does exist , how else could this work locally right?)
I'm working behind a PROXY but to handle this I use this file which is targeted by an Ant step
my.xml configuration
<target name="build" description="generate files with grunt">
<exec executable="cmd" dir="./" failonerror="true">
<arg value="/C" />
<arg value="npm"/>
<arg value="config"/>
<arg value="set"/>
<arg value="proxy"/>
<arg value="http://my_Address/"/>
<arg value="--global"/>
</exec>
<echo message="Installing Deps ..." />
<exec executable="cmd" dir="./" failonerror="true">
<arg value="/C" />
<arg value="npm"/>
<arg value="install"/>
</exec>
<echo message="generate files..." />
<exec executable="cmd" dir="./" failonerror="true">
<arg value="/C" />
<arg value=".\node_modules\.bin\grunt" />
</exec>
<echo message="Done" />
</target>
First, please make sure your configuration and option with grunt-tfs-unlock is correct without any problem. Details please refer this link grunt-tfs-unlock
Moreover, if it's still not wrok. You can also use the workaround--using the grunt-shell task which leaves you more in charge of the configuration.
Here is a example of using TFS check out with Grunt. This link demonstrates the 'tf checkout' command. However you could also create any other tf command with this pattern.

WIX bootstrapper project install framework and fail to install my application

Below is my complete Bundle.wxs of my Bootstrapper project.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle UpgradeCode="493993E8-50F0-43B2-BEF7-A57F4EAD374D" Name="MYAPPlication Name" Version="1.0.0.0" IconSourceFile="D:\..\Resources\Application_icon.ico">
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<!--<Payload Name="BootstrapperCore.config" SourceFile="$(var.MYAPPlication .TargetDir)\MYAPPlication .BootstrapperCore.config"/>-->
<Payload SourceFile="D:\..\MYAPPlication.msi"/>
<!--<Payload SourceFile="NetfxLicense.rtf"/>-->
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="Netfx4Full"/>
<MsiPackage Name="MSIApplication.msi" Compressed="yes" SourceFile="D:\.\MSIApplication.msi" Vital="yes">
<MsiProperty Name="ARPSYSTEMCOMPONENT" Value="1"/>
</MsiPackage>
</Chain>
</Bundle>
<Fragment>
<WixVariable
Id="WixMbaPrereqPackageId"
Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
<util:RegistrySearch
Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4FullVersion" />
<util:RegistrySearch
Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Value="Version"
Variable="Netfx4x64FullVersion"
Win64="yes" />
<PackageGroup
Id="Netfx4Full">
<ExePackage
Id="Netfx4Full"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
Vital="yes"
SourceFile="D:\...\dotNetFx40_Full_x86_x64.exe"
DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"
DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
</PackageGroup>
</Fragment>
</Wix>
After building the above bootstrap project i am getting two files,1) The Framework i included (dotNetFx40_Full_x86_x64.exe)and another is an 2)EXE File with MYApplication name and ICON (MYAPPlication.exe). I removed the framework in my system and double clicked the MYAPPlication.exe,it installed the framework and closed.My actual msi application (MSIApplication.msi) what i included is not installed after framework install.
I already have a setup project and that outputs the .msi file(MSIApplication.msi).I have added this msi in Bundle.wxs.
I need to install framework if not exist and follows it should install my msi application(MSIApplication.msi),when the user double clicks MYAPPlication.exe.Is it possible with wix bootstraper project.

Unresolved reference to symbol in Wix

I am trying to create a installer for MVC4 application using Wix. I found an example that shows how to create an installer for a MVC4 Application at this link
But when I try to build the Wix Setup Project, it gives me errors like below
Error 16 Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents'
in section 'Product:{D16E42B5-3C6F-4EE5-B2F4-727BF8B74A92}'.
C:\Users\Baris\Desktop\New folder\WIXInstallerDemo-master\DemoWebsite.Setup\Product.wxs 15
1 DemoWebsite.Setup
Error 17 Unresolved reference to symbol 'WixComponentGroup:DemoWebsiteIssConfiguration'
in section 'Product:{D16E42B5-3C6F-4EE5-B2F4-727BF8B74A92}'.
C:\Users\Baris\Desktop\New folder\WIXInstallerDemo-master\DemoWebsite.Setup\Product.wxs 16
1 DemoWebsite.Setup`
I tried adding WixUIExtension as a reference but it doesn't work.
This is the Product.wxs. And feature node's children nodes causes this error
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{D16E42B5-3C6F-4EE5-B2F4-727BF8B74A92}" Name="Demo website setup" Language="1033" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="9279b740-8419-45c4-9538-6a45f8e949c7">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="DemoWebsite.cab" EmbedCab="yes" />
<Property Id="DB_USER" Value="sa"/>
<Property Id="DB_PASSWORD" Value="sa"/>
<Property Id="DB_SERVER" Value="LOCAL"/>
<Property Id="DB_DATABASE" Value="DemoWebsite"/>
<Feature Id="ProductFeature" Title="DemoWebsite.Setup" Level="1">
<ComponentGroupRef Id="MyWebWebComponents" />
<ComponentGroupRef Id="DemoWebsiteIssConfiguration" />
</Feature>
<!-- Specify UI -->
<UIRef Id="MyUI" />
<Property Id="WIXUI_INSTALLDIR" Value="INETPUB" />
</Product>
<Fragment>
<!-- Will default to C:\ if that is the main disk-->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Will reference to C:\inetpub-->
<Directory Id="INETPUB" Name="Inetpub">
<!-- Will reference to c:\Inetpub\Demowebsite-->
<Directory Id="INSTALLFOLDER" Name="DemoWebsite">
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
What am I doing wrong? I know its very specific for SO but I cannot find any solution on the web.
I am using VS 2012- Wix 4.0
The error message says it all: it expects a ComponentGroup-tag containing your components (containing e.g. files or registry keys). If you take a look at the example project that you linked in your question, the <ComponentGroupRef Id="DemoWebsiteIssConfiguration" />-element references a ComponentGroup with the name DemoWebsiteIssConfiguration. You can find this in the file DemoWebsite.Setup\IISConfiguration.wxs:
<ComponentGroup Id="DemoWebsiteIssConfiguration">
<ComponentRef Id="InstallWebsite" />
<ComponentRef Id="DemoWebsiteAppPool" />
</ComponentGroup>
It is a ComponentGroup which contains two components or, in this case, references to two components. These components are defined above the ComponentGroup-element in the same file.
Regarding the other ComponentGroupRef with the id MyWebComponents: The referenced ComponentGroup is created dynamically during the build. You can take a look at the file DemoWebsite.Setup\setup.build. This file is a MSBuild-file used to build the setup. It contains a target named Harvest that invokes heat, another tool in the WiX Toolset package. heat will parse e.g. a directory and gather all the files contained within and put them in a ComponentGroup that you can reference in your source file. I.e. you define a reference to a ComponentGroup and then you can create the content of this dynamically. This way you don't have to bother if a file is added to or removed from the project, as heat will gather them dynamically.
<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec
Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
The name of the dynamically created ComponentGroup is defined with the parameter -cg. you can invoke heat with the parameter -? for a short description of the possible parameters.

How to start two socket.io processes in a single worker role?

I have to start two socket.io processes in my azure worker role. I followed the steps in this link
Below is my ServiceDefinition.csdef
<WorkerRole name="WorkerRole1">
<Startup>
<Task commandLine="setup_worker.cmd > log.txt" executionContext="elevated">
<Environment>
<Variable name="EMULATED" value="false"/>
<Variable name="RUNTIMEID" value="node" />
<Variable name="RUNTIMEURL" value="http://az413943.vo.msecnd.net/node/0.6.20.exe" />
</Environment>
</Task>
</Startup>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="tcp" port="80" />
</Endpoints>
<Runtime>
<Environment>
<Variable name="PORT">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/Endpoints/Endpoint[#name='HttpIn']/#port" />
</Variable>
<Variable name="EMULATED">
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/#emulated" />
</Variable>
</Environment>
<EntryPoint>
<ProgramEntryPoint commandLine="node.cmd .\server.js" setReadyOnProcessStart="false" />
</EntryPoint>
</Runtime>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="WorkerLocalStorage" cleanOnRoleRecycle="false" sizeInMB="1024" />
</LocalResources>
In this I am starting server.js on runtime, but I would also like to start another socket.io script along with it. The reason being I dont want to use another worker role for a small application. Just to save cost. I tried to start it as a start up task but the worker role was hanging/cycling when i started the cloud service in emulator with no error info in the output dialog box. So am guessing the socket.io scripts can only be started in the runtime section. Is there any way I can start both my socket.io scripts in a single worker role?
You can do this multiple ways:
Start the process via a startup task
Start the process from the role entry point.
For #1, if you were seeing the role hanging/cycling then it is because of a bug in your startup task, not because Azure prevents you from running a socket.io script. See http://blogs.msdn.com/b/kwill/archive/2013/08/09/windows-azure-paas-compute-diagnostics-data.aspx for how to troubleshoot this issue, in particular the Troubleshooting Scenario 2 (http://blogs.msdn.com/b/kwill/archive/2013/08/26/troubleshooting-scenario-2-role-recycling-after-running-fine-for-2-weeks.aspx). Also, make sure you set the startup task as background so that the host bootstrapper is not waiting for the process to exit before continuing with the role startup process.
For #2, you would have to either modify node.cmd to spawn two processes, or switch to use a different role entry point and have that role entry point start the node.cmd along with your other script.

Categories

Resources