You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ExePackage elements need DetectCondition attribute #3
In the example in the Samples wiki, the ExePackage element does not have a DetectCondition attribute. You need a DetectCondition for UninstallCommand to be called. Honestly it is a long standing mistake in the WiX Toolset that the DetectCondition was not required that is planned to be fixed in WiX Toolset v4.
Would be good to add the DetectCondition attribute to the example.
Will do. With previous releases there was no cheap way to detect extensions' presence but the new query API could make that possible now for v3s (doesn't have to load the entire Extension Manager API). Is that something BA functions could enable?
Actually, that still wouldn't work for previous extension versions or on previous releases. If the DetectCondition were always false, it would at least attempt to install the extension each time which is almost a no-op (incurs detection time across all installed versions) to VSIXInstaller of the extension is installed.
This came up today in a discussion. Basically, there's no conceivable way to author a DetectCondition that works for multiple instances. This is why in the WIP I recommend generating install commands at runtime, which currently to my knowledge is not supported by Burn nor am I advocating that it should be.
However, to support uninstall, would it be possible to rely on a BA function? It seems, however, only a single BA function is supported and not something that can be provided by an extension.
I have been trying to incorporate the bootstrapper into a WiX bundle for our internal extensions. It has been rather troublesome so far. We've had issues with the installer failing if we're just doing something like:
That has worked, except that an upgrade now uninstalls the extension, installs the extension, and then runs the uninstaller of the previous version, which uninstalls the extension again.
So I copied the entire standard bootstrapper code and modified it to set a variable if the installer is called as part of an upgrade. I'm using that variable in the detect condition which now looks like this: WixBundleInstalled AND NOT IsRunAsPartOfUpgrade.
Everything seemed to work now, but upgrading the installation takes ages thanks to all the stuff the VSIX installer is doing during every action.
Got another bug report today. The uninstaller failed:
Some kind of .NET exception happened in the VSIX Installer, then the cache directory... got cleared? No real idea what's happening there, but we can't uninstall.
Actual guidance on how to use the VSIX Bootstrapper in a WiX bundle would be nice because that wiki page is just wrong and leaves everyone trying to implement such an installer to a lot of guesswork. I'm almost tempted to just write my own VSIX bootstrapper that does all this stuff internally because trying to wrap WiX around this utility is painful to say the least.
The VSIXBootstrapper is just a thin wrapper around VSIXInstaller. If VSIXInstaller failed, as you noted above, please file a bug report at https://developercommunity.visualstudio.com.
I'm aware that I should file a bug report there for that specific issue, but thanks for mentioning it. I'll try to gather more data about that issue and might post the bug report then.
Activity
heaths commentedon Feb 13, 2017
Will do. With previous releases there was no cheap way to detect extensions' presence but the new query API could make that possible now for v3s (doesn't have to load the entire Extension Manager API). Is that something BA functions could enable?
heaths commentedon Feb 13, 2017
Actually, that still wouldn't work for previous extension versions or on previous releases. If the DetectCondition were always false, it would at least attempt to install the extension each time which is almost a no-op (incurs detection time across all installed versions) to VSIXInstaller of the extension is installed.
heaths commentedon Mar 13, 2018
This came up today in a discussion. Basically, there's no conceivable way to author a
DetectConditionthat works for multiple instances. This is why in the WIP I recommend generating install commands at runtime, which currently to my knowledge is not supported by Burn nor am I advocating that it should be.However, to support uninstall, would it be possible to rely on a BA function? It seems, however, only a single BA function is supported and not something that can be provided by an extension.
oold commentedon Oct 4, 2022
I have been trying to incorporate the bootstrapper into a WiX bundle for our internal extensions. It has been rather troublesome so far. We've had issues with the installer failing if we're just doing something like:
I don't exactly know why, but it sometimes this fails if the extension is already installed, so I proceeded to add this:
That has worked, except that an upgrade now uninstalls the extension, installs the extension, and then runs the uninstaller of the previous version, which uninstalls the extension again.
So I copied the entire standard bootstrapper code and modified it to set a variable if the installer is called as part of an upgrade. I'm using that variable in the detect condition which now looks like this:
WixBundleInstalled AND NOT IsRunAsPartOfUpgrade.Everything seemed to work now, but upgrading the installation takes ages thanks to all the stuff the VSIX installer is doing during every action.
Got another bug report today. The uninstaller failed:
Some kind of .NET exception happened in the VSIX Installer, then the cache directory... got cleared? No real idea what's happening there, but we can't uninstall.
Actual guidance on how to use the VSIX Bootstrapper in a WiX bundle would be nice because that wiki page is just wrong and leaves everyone trying to implement such an installer to a lot of guesswork. I'm almost tempted to just write my own VSIX bootstrapper that does all this stuff internally because trying to wrap WiX around this utility is painful to say the least.
heaths commentedon Oct 4, 2022
The VSIXBootstrapper is just a thin wrapper around VSIXInstaller. If VSIXInstaller failed, as you noted above, please file a bug report at https://developercommunity.visualstudio.com.
oold commentedon Oct 4, 2022
I'm aware that I should file a bug report there for that specific issue, but thanks for mentioning it. I'll try to gather more data about that issue and might post the bug report then.
yang-shuaijun commentedon Nov 22, 2023
How to write the DetectCondition expression? Colud you provide the example? I'm confused with this attribute.
heaths commentedon Nov 27, 2023
Picoman Yang (@yang-shuaijun) please see https://wixtoolset.org for docs and support of WiX.