-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify MS Build task to include configuration and platform parameters #1014
Comments
Yes it is a good idea. |
I forgot I modified that variable, but I just checked what happens if I use WixBinPackage: "Unhandled Exception: WixSharp.WixSharpException: WiX binaries cannot be found." I'm using the wix nuget package to avoid having to install Wix on all developer and buildserver PC's. maybe that's not expected by wixsharp? |
That's interesting.
Are you saying that if you pass If you doe not have WiX installed but only the package referenced by project then this it the path that WixSharp is using by default in
So something is not working as expected in your case... |
We have configured Nuget to use a different folder then the userprofile folder you indicate, that might cause the issue. I looked up the WixExtDir: it is defined in the wix.props file of the wix nuget package and points to the tools directory: <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WixInstallPath>$(MSBuildThisFileDirectory)..\tools</WixInstallPath>
<WixExtDir>$(WixInstallPath)\</WixExtDir>
<WixTargetsPath>$(WixInstallPath)\wix.targets</WixTargetsPath>
<LuxTargetsPath>$(WixInstallPath)\lux.targets</LuxTargetsPath>
<WixTasksPath>$(WixInstallPath)\WixTasks.dll</WixTasksPath>
<WixSdkPath>$(WixInstallPath)\sdk\</WixSdkPath>
<WixCATargetsPath>$(WixSdkPath)wix.ca.targets</WixCATargetsPath>
</PropertyGroup>
</Project> |
Is there a conclusion for this issue? |
Sorry, I somehow missed your "We have configured Nuget..." message. Thus this is what we have. WixSharp implements the mechanism for passing a custom location of the WiX bin folder via MSBuild command parameters. Currently it is done via an environment variable that is under complete user control. Thus I am not sure I see a good reason to replace the current solution. But where does it leave you? You can simply tunnel set WixBinPackage=%WixExtDir% either per process or globally and I expect it to address your issue. |
Although I see why being dependent on another package it's property does not feel very reliable, it is not just a package: it is the main package you are dependent on. Is there a way to pass in the WinExtDir only if it is defined? |
Absolutely, you can define it directly in your build script: class Script
{
static public void Main()
{
if (Environment.GetEnvironmentVariable("WixExtDir") != null)
Compiler.WixLocation = Environment.GetEnvironmentVariable("WixExtDir");
. . . This is by far a more preferred way. More reliable and even debugable. This approach is almost always overlooked. |
It's not really an issue to add that line, but can't that line be added to WixBinLocator? That class seems to be full of options to try to find the wix binaries anyhow, it seems convient to add it there? |
good idea, I have my reservations against putting anything to the msbuild task as it is such a hard to control mechanizm. |
Done. |
Looks good! |
The change will be available in the very next release |
Will the configuration and platform properties also be added to the MSBuild task (that was the original intent of this ticket) or is that for later? |
* Added full UI for uninstalling from control panel. The feature can be enabled via `project.EnableUninstallFullUI(...)` * Nsis Bootstrapper - Added support for Nsis Bootstrapper compression. - Added sample `BuildScriptWithCompressor` (Samples/Bootstrapper/NsisBootstrapper/setup.cs) * Issue #1025: Add generated children of TypeLib to element * Issue #1014: Modify MS Build task to include configuration and platform parameters * Added support for `WixStandardBootstrapperApplication.HyperlinkSidebarLicense`. * Issue #1023: Copy File Not working; Fixed misspelled field name * Introduce logging options for UninstallFullUI feature * Issue #1005: Request: Arm64 support * Issue #1001: Fix null reference exception if SDK is located inside the wixlocation… * Issue #999: Multiple windows services to single .exe * Issue #995: IgnoreWildCardEmptyDirectories with 1.17.0 causes Wxs generation to never finish with multiple top-level dirs * Fixed: Respect TargetFileName on OverwriteOnInstall option
In the wixsharp nuget package the build task does not pass on parameters of the build. This prevents usecases as building an installer for both debug and release or for different CPU architectures. I stopped using the task from wixsharp all together and copied my own task in the project instead.
This is the task that I'm using:
This allows me to set the outputpath of the installer to something specific for the configuration/platform.
Can these parameters be added to the task in the wixsharp package?
The text was updated successfully, but these errors were encountered: