-
Notifications
You must be signed in to change notification settings - Fork 182
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
Updating WixSharp leads to malfuncion of SetEvVar #569
Comments
Hi Oleg,
|
OK, txs. |
OK I think I may have an idea about what is going on. It is not expected that user modifies .csproj file by inserting I specifically created this target so the project file manipulations during package install/upgrade are safe and do not depend on any other element in the project file. Thus
|
OK. How's about updating WixSharp? Isn't WixSharp.Targets replaced? I believe I had this situation in the past. As workaround I put the setenvvar in csproj. Would it be a solution to create a WixSharpCustom.targets and include it in csproj? |
I think you are right. The targets file will be replaced. Then editing targets is not an option. I will need to see how to change the ps1 algorithm to insert the Changing the issue to "Enhancement". Though there is a very simple practical solution that can be used until the fix is available:
That's it. It will work simply because |
Ah, thx, good hint. |
Yeah, I know it's XML. XML is not a problem. Will try to wrap it up rather sooner than later. |
I have done some investigation and found that the problem is not caused by the WixSharp ps1 script but rather by VS NuGet integration. Let's recapture: Before Update (works): Injected by VS - <Import Project="..\..\packages\WixSharp.bin.1.9.2\.../>
Injected by VS - <Import Project="..\..\packages\WixSharp.1.9.2\.../>
Injected by WixSharp - <UsingTask AssemblyFile="$(SolutionDir)packages.../>
Injected by manually - <Target Name="BeforeBuild">...> After Update (does not work): Injected by manually - <Target Name="BeforeBuild">...>
Injected by VS - <Import Project="..\..\packages\WixSharp.bin.1.9.2\.../>
Injected by VS - <Import Project="..\..\packages\WixSharp.1.9.2\.../>
Injected by WixSharp - <UsingTask AssemblyFile="$(SolutionDir)packages.../> Now, I deliberately placed there Position of BTW the only reason I disabled is that I was not sure if people are going need this feature. But since you do.... I have no problems of re-enabling this feature. Will be available in the next release. |
OK, interesting. Thx for your effort. Sorry for saying "ugly". |
* VS project templates - added packages.config files * Added Condition-s for .NET Frameworks 4.7.1 and 4.7.2 * Issue #569: Updating WixSharp leads to malfuncion of SetEvVar * Added support for `UI.Error` WiX element * Issue #552: Question: Install 2 windows services in same installer * Issue #541: Installing 2 Services in the same installer results in … * Samples update * Issue #560: Semantic difference between UninstallCondition and IsUninstalling * Issue #564: Correct variable name of SequentialGuid initialization. * Issue #562: Typo in Compiler.cs comments * Issue #561: Typo in WixProject.cs * Added missing namespace in custom dialog template, fixed comment. * Added explicit `WixEntity.ComponentId` property * Issue #551: Cannot include extra .wxs as part of a bundle * Issue #542: ServiceInstaller.StartOn/StopOn/RemoveOn - Documentation bug * Issue #544: Failed while processing WebSites; added support for `IISVirtualDir.AttributesDefinition`
After upgrading from 1.9.3 to 1.9.4 through NuGet packages, build raises an error previously not occurring and seemingly be related to this issue and commit:
After reverting back to 1.9.3 build runs fine again. The csproj do not contain SetEnvVar. By upgrade from 1.9.3 to 1.9.4, no changes were made to csproj other than the version numbers of packages. Did not yet find a cause. |
Same here as @monty241 - builds locally but fails on Teamcity with the following (paths redacted) The dll is however in that path - did something change with the version of the dll or .net version or something? Could explain why it works locally (VS 2017) but not on team city which is running an older version. |
actually correction - the path looks wrong in my build server - it says can't find the following path There is no slash between [solutionfolder] and packages |
Hi Oleg, updated to 1.9.4 but so success, same as @monty241. I saw the setenvar is now uncommented in WixSharp.Targets but there seems still to be the problem of the order of the using task in csproj. |
Had to revert to 1.9.3 and can confirm, that modifying WixSharp.targets works. Actually I had to add the Configuration=$(Configuration) Parameter. |
Guys, I am relying on your feedback here. WixSharp integrattion with VS does not require Until v1.9.4 the use of SetEnvVar.dll was disabled but still present in the package since it was an interesting technical solution. After this very thread was opened I have reevaluated the benefits of the old SetEnvVar.dll approach and decided to re-enable it. This is what v1.9.4. Though there were no technical reason to do that. Just a single feedback on a less trivial use-case. But... I am happy to roll it back and disable SetEnvVar.dll for good if it is causing any problems. What do you (as true WixSharp) users think? |
We don't use SetEnvVar (I think). For now, I propose commenting it out completely. Git comes to the rescue when ever needed again :-) |
Hi Oleg, we user SetEnvVar get the configuration name an create slightly different msi packages base on that. Another benefit is, to have the SolutionPath to make thing more independet from actual directory structure. If there is another way to get this information easily its welcome. |
Regarding 1.9.4: |
OK then. Since 1.9.4 does not exhibit any WiX/WixSharp problems I am leaning towards keeping SetEnvVar enabled. If a true problem does surfaced then I will disable it with the idea that it can be enabled manually. |
Thank you guys for the feedback. |
Hi,
recently I updated WiXSharp to V1.9.3. Afterwards the Setup Project did not build anymore. I got a System.ArgumentNullException in a statement refering to Environment variables like this:
Further investigation did reveal that the update process reordered some lines in csproj:
Before:
After Update:
After manually reordering the UsingTask before SetEnvVar everything was fine again.
Correct order:
This is an ugly behavoir and should be avoided.
Josef
The text was updated successfully, but these errors were encountered: