Skip to content

Commit

Permalink
Merge pull request #4 from JavaCardSpot-dev/development
Browse files Browse the repository at this point in the history
Development - installer
  • Loading branch information
Aiosa authored Nov 21, 2019
2 parents a2e71f2 + 58b294f commit 6a2ca54
Show file tree
Hide file tree
Showing 13 changed files with 306 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/modules/JCAppStore.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 77 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//import org.gradle.internal.os.OperatingSystem;

plugins {
id 'java'
id 'com.bmuschko.izpack' version '3.0'
}

group 'cz.muni.crocs.appletstore'
Expand All @@ -10,6 +13,12 @@ sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()

maven {
// distribution repository for izpack
name "Ice Maven Release Repository"
url "http://anonsvn.icesoft.org/repo/maven2/releases"
}
}

dependencies {
Expand All @@ -29,4 +38,71 @@ dependencies {
compile group: 'org.ini4j', name: 'ini4j', version: '0.5.4'
compile group: 'org.simplejavamail', name: 'simple-java-mail', version: '4.1.2'

}
izpack 'org.codehaus.izpack:izpack-dist:5.1.3'
}

izpack {
//generate folders deploy, out, res, main
def folder = file("$buildDir/deploy/out/src/main/resources")
if( !folder.exists() ) {
folder.mkdirs()
}

def scripts = file("$buildDir/deploy/scripts")
if( !scripts.exists() ) {
scripts.mkdirs()
}

copy {
from file("README.md")
into file("$buildDir/deploy")
}

copy {
from "src/main/resources"
into "$buildDir/deploy/out/src/main/resources"
}

copy {
from "installer/dependency"
into "$buildDir/deploy/scripts"
}

//todo somehow the jar dependency does not generate it quickly enough so the code is working for the 2nd time :(
//maybe add this into jar file
copy {
from file("build/libs/JCAppStore-${version}.jar")
into file("$buildDir/deploy/out")
}

baseDir = file("$buildDir/deploy")
installFile = file('installer/installer.xml')
outputFile = file("$buildDir/deploy/JCAppStore-${version}-installer.jar")
compression = 'deflate'
compressionLevel = 9
appProperties = ['app.group': 'CRoCS', 'app.name': 'jcAppStore', 'app.title': 'JCAppStore',
'app.version': version, 'app.subpath': "JCAppStore-$version"]
}

izPackCreateInstaller.dependsOn jar

jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
manifest {
attributes 'Main-Class': 'cz.muni.crocs.appletstore.SplashScreen'
}

// if (OperatingSystem.current().isLinux()) {
//
// doLast {
// project.exec {
// commandLine('chmod', '+x', "build/deploy/JCAppStore-${version}-installer.jar")
// }
// }
// }
}




33 changes: 33 additions & 0 deletions installer/dependency/ProcessPanel.Spec.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<izpack:processing version="5.0"
xmlns:izpack="http://izpack.org/schema/processing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/processing http://izpack.org/schema/5.0/izpack-processing-5.0.xsd">

<!-- todo add this into https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491734/Process+Panel-->
<job name="store public key" final="true">
<os family="windows" />
<executefile name="$INSTALL_PATH/scripts/keyring.bat" workingDir="$INSTALL_PATH" />
</job>
<!-- <job name="store public key">-->
<!-- <os family="unix" />-->
<!-- <executefile name="$INSTALL_PATH/scripts/xyz.sh">-->
<!-- <arg>doit</arg><arg>$variable</arg>-->
<!-- </executefile>-->
<!-- </job>-->

<!-- <job name="run on failure" catch="true">-->
<!-- <os family="unix" />-->
<!-- <executefile name="$INSTALL_PATH/scripts/run_on_fail.sh">-->
<!-- <arg>doit</arg><arg>$variable</arg>-->
<!-- </executefile>-->
<!-- </job>-->
<!-- <job name="run always" final="true">-->
<!-- <os family="unix" />-->
<!-- <executefile name="$INSTALL_PATH/scripts/run_always.sh">-->
<!-- <arg>doit</arg><arg>$variable</arg>-->
<!-- </executefile>-->
<!-- </job>-->

<onFail previous="false" next="true" />
<onSuccess previous="false" next="true" />
</izpack:processing>
Binary file added installer/dependency/jcappstore.ico
Binary file not shown.
8 changes: 8 additions & 0 deletions installer/dependency/keyring.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@ECHO OFF
echo "Include public key into GnuPG key ring"

gpg --import ./scripts/store.asc

(echo 5 && echo y)|gpg --command-fd 0 --expert --edit-key 7B9FE0F5 trust

echo "Done!"
22 changes: 22 additions & 0 deletions installer/dependency/shortcutSpec.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<izpack:shortcuts version="5.0"
xmlns:izpack="http://izpack.org/schema/shortcuts"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/shortcuts http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">

<shortcut
name="JCAppStore"
target="$INSTALL_PATH\JCAppStore-1.0.jar"
description="JCAppStore"
workingDirectory="$INSTALL_PATH"
iconFile="$INSTALL_PATH\scripts\jcappstore.ico"
initialState="normal"
programGroup="yes"
desktop="yes"
applications="yes"
startMenu="yes"
startup="no">

<createForPack name="JC Core"/>
</shortcut>
</izpack:shortcuts>
Binary file added installer/dependency/store.asc
Binary file not shown.
22 changes: 22 additions & 0 deletions installer/dependency/unixShortcutSpec.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<izpack:shortcuts version="5.0"
xmlns:izpack="http://izpack.org/schema/shortcuts"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/shortcuts http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">

<shortcut
name="JCAppStore"
target="$INSTALL_PATH/JCAppStore-1.0.jar"
description="JCAppStore"
workingDirectory="$INSTALL_PATH"
iconFile="$INSTALL_PATH/scripts/jcappstore.ico"
initialState="normal"
programGroup="yes"
desktop="yes"
applications="yes"
startMenu="yes"
startup="no">

<createForPack name="JC Core"/>
</shortcut>
</izpack:shortcuts>
108 changes: 108 additions & 0 deletions installer/installer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">

<natives>
<native type="izpack" name="ShellLink.dll"/>
<native type="izpack" name="ShellLink_x64.dll"/>
<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>
<native type="3rdparty" name="COIOSHelper_x64.dll" stage="both">
<os family="windows"/>
</native>
</natives>

<info>
<appname>JCAppStore</appname>
<appversion>1.0</appversion>
<appsubpath>JCAppStore-1.0</appsubpath>
<javaversion>1.8</javaversion>
<authors>
<author name="Jiří Horák" email="horakj7@gmail.com"/>
</authors>
<url>https://github.com/JavaCardSpot-dev/JCAppStore</url>
<uninstaller />
<run-privileged uninstaller="yes"/>
</info>

<locale>
<langpack iso3="eng"/>
</locale>

<guiprefs width="800" height="400" resizable="no">
<splash>images/peas_load.gif</splash>
<laf name="substance">
<os family="windows" />
<os family="unix" />
<param name="variant" value="mist-silver" />
</laf>
<laf name="substance">
<os family="mac" />
<param name="variant" value="mist-aqua" />
</laf>
<modifier key="useHeadingPanel" value="yes" />


<modifier key="useButtonIcons" value="yes"/>
<modifier key="useLabelIcons" value="no"/>
<modifier key="labelGap" value="2"/>
<modifier key="useHeadingPanel" value="no"/>
<modifier key="headingImageOnLeft" value="yes"/>
<modifier key="headingLineCount" value="1"/>
<modifier key="headingFontSize" value="1.5"/>
<modifier key="headingBackgroundColor" value="0x00ffffff"/>
<modifier key="headingPanelCounter" value="progressbar"/>
<modifier key="headingPanelCounterPos" value="inNavigationPanel"/>
</guiprefs>

<resources>
<res id="InfoPanel.info" src="readme.md" parse="yes"/>
<res src="scripts/ProcessPanel.Spec.xml" id="ProcessPanel.Spec.xml"/>
<res src="scripts/shortcutSpec.xml" id="shortcutSpec.xml"/>
<res src="scripts/unixShortcutSpec.xml" id="Unix_shortcutSpec.xml"/>
</resources>

<listeners>
<listener classname="RegistryInstallerListener" stage="install" >
<os family="windows"/>
</listener>
<listener classname="RegistryUninstallerListener" stage="uninstall" >
<os family="windows"/>
</listener>

</listeners>

<panels>
<panel classname="TargetPanel"/>
<panel classname="ShortcutPanel" id="my_shortcutpanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ProcessPanel"/>

<panel classname="InfoPanel" />
<panel classname="FinishPanel"/>
</panels>

<variables>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
</variables>

<packs>
<pack name="JC Core" required="yes">
<description>The core files needed for the application</description>
<fileset dir="out" targetdir="${INSTALL_PATH}" override="true"/>
<fileset dir="scripts" targetdir="${INSTALL_PATH}\scripts" override="true"/>
<os family="windows"/>
</pack>

<!-- <pack name="JC Core" required="yes">-->
<!-- <description>The core files needed for the application</description>-->
<!-- <fileset dir="out" targetdir="${INSTALL_PATH}" override="true"/>-->
<!-- <fileset dir="scripts" targetdir="${INSTALL_PATH}/scripts" override="true"/>-->
<!-- <os family="unix"/>-->
<!-- </pack>-->
</packs>

</izpack:installation>
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = 'JCAppStore'

rootProject.name = 'JCAppStore'
7 changes: 6 additions & 1 deletion src/main/resources/Lang_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ detect_cards = Detecting cards...
failed_detect = Failed to load card.
launch = Creating window...
card_refresh = RELOAD CARD
store_refresh = REDOWNLOAD STORE
store_refresh = RE-DOWNLOAD STORE
no_reader = No card reader detected.
E_service = No card service enabled.
H_service = Smart card resource manager is offline. The card readers won't work. Enable smart card resource manager and \
restart the application.
H_routine = The card detection routine was killed after repeated failures. To restore automatic card detection, please \
restart the application.
no_channel = Cannot detect card channel. Raise issue on our github repo.
E_fail_to_detect_sd = Could not detect Security Domain. The card is probably locked or otherwise inaccessible.
no_card = No card in selected reader.
Expand Down

0 comments on commit 6a2ca54

Please sign in to comment.