In Wix 3.11 I am using burn to define a bundle and a chain of msi packages to install.
Something like:
<Chain>
<!-- List of prerequisites: -->
<PackageGroupRef Id="Prereq1"/>
<PackageGroupRef Id="Prereq2"/>
<PackageGroupRef Id="Prereq3"/>
<!-- Our packages -->
<PackageGroupRef Id="Package1"/>
<PackageGroupRef Id="Package2"/>
</Chain>
In Package1 I define the following:
<WixVariable Id="SrcFolder" Value="..\..\..\..\path-to-SrcFolder" />
<PackageGroup Id="Package1">
<MsiPackage gd:LicenseId="Feature1" InstallCondition="Feature1" gd:Optional="no" SourceFile="!(wix.SrcFolder)\Feature1.msi" Compressed="no" Name="packages\Feature1.msi">
<MsiProperty Name='LICENSEFOLDER' Value='[LicenseFolder]'/>
<MsiProperty Name='COMPANYNAME' Value='[Organization]'/>
<MsiProperty Name='INSTALLFOLDER' Value='[InstallFolder]'/>
</MsiPackage>
<MsiPackage gd:LicenseId="Feature2" InstallCondition="Feature2" gd:Optional="yes" SourceFile="!(wix.SrcFolder)\Feature2.msi" Compressed="no" Name="packages\Feature2.msi">
</MsiPackage>
</PackageGroup>
I would like to install my "Feature2" package only if there is a environmental variable defined in the installing machine, (ENV_VAR), and silently don't install the package it if that is not the case.
How could I do that?
Related
Update. With Matt Ward's help I traced this to a bad config file. The following ~/.config/NuGet/NuGet.Config works for me
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" protocolVersion="2" />
</packageSources>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
I can do the following without any problems:
/opt/mono/mono-5.2.0.196-tarball/bin/mono ~/nuget.exe install -version 2.6.4 nunit
However, when I try to compile fsharp under the same installation of Mono, I get the following error. This is in the fsharp4 branch. What might I be doing wrong, please? Many thanks.
Project "/dir/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj"
(default target(s)): Target CallFsSrGen: Created directory
"obj/proto/./" Tool
/dir/src/fsharp/FSharp.Build-proto/../../../lib/bootstrap/4.0/fssrgen.exe
execution started with arguments:
/dir/src/fsharp/FSharp.Build/FSBuild.txt obj/proto/./FSBuild.fs
FSBuild.resx Target BeforeBuild: Executing: mono
--runtime=v4.0.30319 /dir/src/fsharp/FSharp.Build-proto/../../../.nuget/NuGet.exe restore
packages.config -PackagesDirectory packages Unable to find version
'2.6.4' of package 'NUnit'. Unable to find version '2.6.4' of
package 'NUnit.Runners'. /dir/src/FSharpSource.targets: error :
Command 'mono --runtime=v4.0.30319
/dir/src/fsharp/FSharp.Build-proto/../../../.nuget/NuGet.exe restore
packages.config -PackagesDirectory packages' exited with code: 1.
Task "Exec" execution -- FAILED Done building target "BeforeBuild"
in project
Check what version of NuGet you are using and what NuGet package sources are enabled. Either there no NuGet package sources enabled or you are using a NuGet v2 .exe with a NuGet v3 package source.
If there is no NuGet.Config file that is provided with the FSharp build source code you are using then check the package sources listed in the file ~/.config/NuGet/NuGet.config. I suspect that it only has the v3 package source https://api.nuget.org/v3/index.json which cannot be used with a NuGet.exe (v2). So you would either need to update the nuget.exe to a later version or add the NuGet v2 package source into your NuGet.Config file: https://www.nuget.org/api/v2/
I'm trying to deploy my website from github to Azure but there are some errors showing up every time I try to do it, this is part of the log from Azure:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
Restoring NuGet package Microsoft.Extensions.Caching.Abstractions.1.0.0.
Restoring NuGet package Microsoft.Extensions.Caching.Memory.1.0.0.
Restoring NuGet package Microsoft.Extensions.DependencyInjection.1.0.0.
WARNING: Unable to find version '1.0.0' of package 'Microsoft.Extensions.Caching.Abstractions'.
D:\home\.nuget: Package 'Microsoft.Extensions.Caching.Abstractions.1.0.0' is not found on source 'D:\home\.nuget'.
https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\microsoft.extensions.caching.abstractions\1.0.0\microsoft.extensions.caching.abstractions.1.0.0.nupkg'.
It does that for a lot of Nuget packages that I have, maybe all of them.
Then after the Warning messages, this other message is showed:
Restoring packages for D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'BundlerMinifier.Core' in D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:\home\site\repository\src\LIGMarine\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\src\LIGMarine\project.json...
Committing restore...
Writing lock file to disk. Path: D:\home\site\repository\src\LIGMarine\project.lock.json
D:\home\site\repository\src\LIGMarine\LIGMarine.xproj
Restore completed in 5151ms.
And then comes the error messages:
Errors in packages.config projects
Unable to find version '1.0.0' of package 'Microsoft.Extensions.Caching.Abstractions'.
D:\home\.nuget: Package 'Microsoft.Extensions.Caching.Abstractions.1.0.0' is not found on source 'D:\home\.nuget'.
https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\microsoft.extensions.caching.abstractions\1.0.0\microsoft.extensions.caching.abstractions.1.0.0.nupkg'.
Feeds used:
D:\home\.nuget
D:\home\.nuget: Package 'System.Interactive.Async.3.0.0' is not found on source 'D:\home\.nuget'.
https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\system.interactive.async\3.0.0\system.interactive.async.3.0.0.nupkg'
This is a resume of the Azure log, I have read about this errors and I have created a Nuget.Config file as I show in the picture, this file is inside the Solution Items folder
This is the code that I have inside the Nuget.Config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
According to this messages, the Nuget packages cannot be found...
Feeds used:
D:\home\.nuget
D:\home\.nuget: Package 'System.Interactive.Async.3.0.0' is not found on source 'D:\home\.nuget'.
https://api.nuget.org/v3/index.json: Could not find file 'D:\home\.nuget\system.interactive.async\3.0.0\system.interactive.async.3.0.0.nupkg'
Maybe it's not looking for the packages the way it should, I'm not sure what means this path: 'D:\home\.nuget\'
What should I do?
EDIT
These are the packages that are not being found, I don't think these are private packages that cannot be found within https://api.nuget.org/v3/index.json:
Microsoft.Extensions.Caching.Abstractions
Microsoft.Extensions.Caching.Memory
Microsoft.Extensions.DependencyInjection
System.Interactive.Async
System.Linq
System.Linq.Expressions
System.Linq.Queryable
System.Globalization
System.Reflection
System.ObjectModel
System.Resources.ResourceManager
System.Reflection.Extensions
System.Runtime
System.Runtime.Extensions
System.Runtime.InteropServices
Microsoft.Extensions.DependencyInjection.Abstractions
System.Threading.Tasks
System.Threading.Tasks.4.0.11
Microsoft.Extensions.Logging.Abstractions
Microsoft.Extensions.Logging.Abstractions.1.0.0
Microsoft.Extensions.Logging
Microsoft.Extensions.Options
Microsoft.Extensions.Primitives
Remotion.Linq
Newtonsoft.Json
System.Collections
System.Collections.Immutable
System.Diagnostics.Debug
System.Diagnostics.DiagnosticSource
System.Collections.Concurrent
System.ComponentModel
System.Threading
.
I have created a new website in Azure and now it works, it seems that the previous website was deploying a previous application from Github and there were some conflicts, everything works fine now
I installed cordova-plugin-googleplus plugin to login using google. After installing I run "cordova build andriod" in CLI, it was successful and apk file works fine for google login. Then for releasing the app I run "ant release" in platforms/android folder in CLI, then build failed with errors like " package com.google.android.gms.auth does not exist import com.google.android.gms.auth". Please give me the solution for this.
Thanks in advance.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
Replace
<framework src="com.google.android.gms:play-services-plus:+" />
<framework src="com.google.android.gms:play-services-identity:+" />
with
<framework src="com.google.android.gms:play-services-plus:9.0.2" />
<framework src="com.google.android.gms:play-services-identity:9.0.2" />
in both plugin.xml as well as platforms/android/project.properties. In my case if I replace only plugin.xml then build.gradle was getting overridden with project.properties content and + version was being used instead of specific version
I'm struggling to get started with F# on Linux using ProjectScaffold.
Specifically: I can't get a project to work with FsUnit/FsCheck/xunit. I
have F# 3.1 and mono 3.12.1 and I'm on Linux (Ubuntu) x64.
I start "MyProject" with:
$ git clone --depth=1 git#github.com:fsprojects/ProjectScaffold.git
$ cd ProjectScaffold && ./build.sh
Then I add a bit of code to "src/MyProject/Library.fs":
module MyProject.X
let four = 4
And then two tests to "tests/MyProject.Tests/Tests.fs":
module MyProject.Tests.X
open Xunit
open FsUnit.Xunit
open FsCheck
open FsCheck.Xunit
open MyProject.X
[<Fact>]
let ``Two plus two is four.`` () =
2 + 2 |> should equal four
[<Property>]
let ``Sorting a sorted list is idempotent.`` (l: int list) =
let s = List.sort l
s = List.sort s
This code works on Visual Studio where I manually added FsCheck, FsUnit, anx xunit 1.9.2 (it fails with later version
for some reason). My test project on Windows/Visual Studio has this config file:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FsCheck" version="1.0.4" targetFramework="net45" />
<package id="FsCheck.Xunit" version="1.0.4" targetFramework="net45" />
<package id="FsUnit.xUnit" version="1.3.0.1" targetFramework="net45" />
<package id="xunit" version="1.9.2" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" />
</packages>
So I edit paket.dependencies to add these packages and remove Nunit:
source https://nuget.org/api/v2
nuget FSharp.Formatting 2.8.0
nuget FSharpVSPowerTools.Core 1.7.0
nuget FAKE
nuget FsCheck 1.0.4
nuget FsCheck.Xunit 1.0.4
nuget FsUnit.xUnit 1.3.0.1
nuget xunit 1.9.2
nuget SourceLink.Fake
github fsharp/FAKE modules/Octokit/Octokit.fsx
Then:
$ mono .paket/paket.exe install
...and it fails because NUnit is referenced somewhere, so I delete the references in tests/MyProject.Tests/paket.references and
$ mono .paket/paket.exe install
works, but
$ ./build.sh
fails, at it cannot find references to FsCheck et al. So I assume that I need to add the references manually, so tests/MyProject.Tests/paket.references is now:
FsCheck
FsCheck.Xunit
FsUnit.xUnit
xunit
...built build.sh fails again: it cannot find FsCheck. I could not find in the paket doc how to add a local dependency (MyProject.Tests should reference MyProject), it might be done automatically.
I had this problem and it took a while for me to figure out a fix. For the project file in the Tests directory, I had to change this:
<Reference Include="FsUnit.NUnit">
<HintPath>..\..\packages\FsUnit.1.3.0.1\Lib\Net40\FsUnit.NUnit.dll</HintPath>
<Private>True</Private>
</Reference>
To this:
<Reference Include="FsUnit.NUnit">
<HintPath>..\..\packages\FsUnit\Lib\Net40\FsUnit.NUnit.dll</HintPath>
<Private>True</Private>
</Reference>
Similarly, for NUnit:
<Reference Include="nunit.framework">
<HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
To:
<Reference Include="nunit.framework">
<HintPath>..\..\packages\NUnit\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
The issue is that on mono, the packages don't have the version in the path but under Visual Studio they do. Once I found this fix, I created two .fsproj files for the tests and I modified the build.sh script to swap the mono-compatible one in when under mono via:
#!/bin/bash
if test "$OS" = "Windows_NT"
then
# no changes in here
else
# fix test fsproj file
mv tests/ProjectName.Tests/ProjectName.Tests.fsproj tests/ProjectName.Tests/ProjectName.Tests.fsproj.vs
mv tests/ProjectName.Tests/ProjectName.Tests.fsproj.mono tests/ProjectName.Tests/ProjectName.Tests.fsproj
# leave the script logic for mono in place
# put project files back to avoid git noticing the swap
mv tests/ProjectName.Tests/ProjectName.Tests.fsproj tests/ProjectName.Tests/ProjectName.Tests.fsproj.mono
mv tests/ProjectName.Tests/ProjectName.Tests.fsproj.vs tests/ProjectName.Tests/ProjectName.Tests.fsproj
fi
Once I made these changes the project works fine under both Visual Studio as well as mono.
I am not quite sure, I understand you: Do you have two fsproj files, one for the production code and one for the unit tests? And are you referencing FsCheck in the fsproj?
Plus, I remember an issue, where if you compile against an older version of .net and reference an assembly compiled against a newer version of .net, it will behave as though there was no reference.
I want to get the set of runtime dependencies from maven in ant. I'm using the maven ant tasks.
I know that you can limit the dependencies by scope (see docs):
<artifact:dependencies filesetId="dependency.fileset" useScope="runtime">
<artifact:pom file="pom.xml" id="myProject" />
</artifact:dependencies>
and that the scope options (from the docs) are:
•compile - Includes scopes compile, system and provided
•runtime - Includes scopes compile and runtime
•test - Includes scopes system, provided, compile, runtime and test
However, I want to get only the runtime dependencies (i.e. exclude compile dependencies). My best idea so far is to get the runtime dependencies and the compile dependencies, and iterate through the runtime dependencies to find those that are not in the compile dependencies, but I haven't yet worked out how to do this.
Any ideas?
You need something along the lines of:
...
<artifact:pom id="maven.project" file="pom.xml"/>
<artifact:dependencies useScope="runtime"
filesetId="dependencies.runtime"
pomRefId="maven.project"
settingsFile="${settings.xml}"/>
...
Then you can use the dependencies.runtime fileset as usual.
I hope this makes more sense.
So this what I tried to get the difference of the runtime and compile file sets (although this makes the assumption that there's nothing in the compile fileset that's not also in the runtime fileset)
<artifact:dependencies filesetId="runtime" scopes="runtime">
<artifact:pom file="pom.xml" id="myProject" />
</artifact:dependencies>
<artifact:dependencies filesetId="compile" scopes="compile">
<artifact:pom file="pom.xml" id="myProject" />
</artifact:dependencies>
<difference id="difference" >
<resources refid="runtime" />
<resources refid="compile" />
</difference>
However, this wasn't producing the results that I expected, so I did the following, and found that the runtime fileset did not contain the compile dependencies.
<echo message="${toString:runtime}" />
<echo message="${toString:compile}" />
So I can just use the runtime scope...