Skip to content

Commit

Permalink
Windows executable
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 20, 2018
1 parent 1e18457 commit 4297eba
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node {

sh "rm -rf build/libs/"
sh "chmod +x gradlew"
sh "./gradlew build uploadArchives --refresh-dependencies --stacktrace"
sh "./gradlew build publish --refresh-dependencies --stacktrace"

stage "Archive artifacts"

Expand Down
41 changes: 39 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ buildscript {
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
classpath 'edu.sc.seis.gradle:launch4j:2.4.4'
}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'edu.sc.seis.launch4j'

sourceCompatibility = 1.8
version = '0.2.0'
version = '0.2.1'
archivesBaseName = "fabric-installer"

// Fetch build number from Jenkins
Expand Down Expand Up @@ -55,5 +59,38 @@ jar {
enabled = false
}

launch4j {
mainClassName = 'net.fabricmc.installer.Main'
icon = "${projectDir}/src/main/resources/icon.ico"
outfile = "${archivesBaseName}-${project.version}.exe"
productName = 'Fabric installer'
manifest = "${projectDir}/l4j-manifest.xml" // https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests This helps with
}

tasks.build.dependsOn 'launch4j'

apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle'
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/maven.gradle'

publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version

artifact (file("${projectDir}/build/launch4j/${archivesBaseName}-${project.version}.exe"))
artifact (jar)
}
}
repositories {
maven {
url "http://mavenupload.modmuss50.me/"
if (project.hasProperty('mavenPass')) {
credentials {
username 'buildslave'
password project.getProperty('mavenPass')
}
}
}
}
}
37 changes: 37 additions & 0 deletions l4j-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!--
Taken from https://docs.microsoft.com/en-us/windows/desktop/sysinfo/targeting-your-application-at-windows-8-1
The main goal of this file to allow the exe to run without admin
-->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>

</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>


</assembly>
Binary file added src/main/resources/icon.ico
Binary file not shown.

0 comments on commit 4297eba

Please sign in to comment.