【问题标题】:Creating msi or exe installer using setupbuilder plugin in gradle for .net project在 .net 项目的 gradle 中使用 setupbuilder 插件创建 msi 或 exe 安装程序
【发布时间】:2017-10-11 11:15:38
【问题描述】:

我有一个使用 gradle 的 MSBuild 插件构建的 .net 项目。在最后的任务中,我想创建一个 .msi 或 .exe 安装程序,包括构建步骤中的 dll。当前的 gradle 构建脚本如下所示:

    buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath "com.ullink.gradle:gradle-msbuild-plugin:2.16"
        classpath "gradle.plugin.de.inetsoftware:SetupBuilder:1.8.0"
    }
}

apply plugin: 'msbuild'
apply plugin: "de.inetsoftware.setupbuilder"

msbuild {
// Project solution file
    solutionFile = 'Test.sln'

    targets = ['Clean', 'Rebuild']
}

setupBuilder {
    vendor = 'MyOrg'
    application = "Test"
    appIdentifier = "Test"
    version = '1.0'
    licenseFile = 'license.txt'
    // icons in different sizes for different usage. you can also use a single *.ico or *.icns file
    icons = 'test.icns'
    // all files for all platforms
    from( 'testbuild' ) {
        include 'bin/Debug/*.dll'
    }
    bundleJre = 1.8
}

msi {
    // files only for the Windows platform

}

当我运行 gradle msi 时,错误是 -

Execution failed for task ':msi'.
> org.gradle.api.internal.file.copy.CopyActionExecuter.<init>(Lorg/gradle/internal/reflect/Instantiator;Lorg/gradle/internal/nativeintegration/filesystem/FileSystem;)V

我正在使用 gradle 4.2.1、wixtools、setupbuilder 1.8。代码块中是否存在我缺少的依赖项或某些内容?

【问题讨论】:

    标签: .net gradle msbuild wix


    【解决方案1】:

    根据GitHub上的插件referenceSetup Builder插件版本1.8需要Gradle版本3.0。当我尝试使用Gradle 版本大于3.0 的Setup Builder 插件版本1.8 时,出现了类似的问题(WiX Toolset 版本为3.11)。您可以使用Gradle 3.0 重试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多