Skip to content
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

Ms autoupdate #84

Merged
merged 42 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2dc9eda
added windows specific options to the pom
Fim-84 Jun 10, 2022
d38ab49
Merge branch 'master' of github.com:unigrid-project/janus-java
Fim-84 Jun 10, 2022
0858838
MS: Created a WIP launcher using update4j
Fim-84 Jun 21, 2022
3a20c46
MS: Made a launcher service in janus
Fim-84 Jun 21, 2022
90bf0e8
MS: providing the service to update4j
Fim-84 Jun 21, 2022
f42a4a9
MS: Added a way for the launcher to start the wallet
Fim-84 Jun 21, 2022
53e0b6a
MS: Added update4j as dependency
Fim-84 Jun 21, 2022
4d99e24
MS: Started work on update check in the wallet
Fim-84 Jun 21, 2022
3d471e6
MS: fixed conflicts
Fim-84 Jun 21, 2022
66a7d98
MS: fixed conflicts
Fim-84 Jun 21, 2022
5081693
MS: Continued work on the look and feel of the bootstrap
Fim-84 Jun 27, 2022
1672351
MS: Added classloder to handel start from the launcher
Fim-84 Jun 27, 2022
a6dfa6c
MS: extraxtion of daemon added
Fim-84 Jun 28, 2022
e9e2a4e
MS: Added update button to the windowbar, continued work on update ha…
Fim-84 Jun 28, 2022
7ccea38
Merge branch 'master' into MS_autoupdate
Fim-84 Jun 28, 2022
c9772bb
MS: got everything to be in the same CDI container
Fim-84 Jun 29, 2022
628f981
MS: reverted some changes that broke the app
Fim-84 Jun 29, 2022
b1cf89d
MS: small changes to the bootstrap
Fim-84 Jun 29, 2022
0fb4ecd
MS: change the path of the zip file
Fim-84 Jun 29, 2022
ec3e2af
MS: Changed witch config to read based on os
Fim-84 Jun 29, 2022
7a2d642
MS: Change the pom to creat installer for the bootstrap
Fim-84 Jul 1, 2022
c30271c
MS: added moduls to module-info and jlink to fix handshake error when…
Fim-84 Jul 2, 2022
354657d
MS: change to user.home insted of user.dir
Fim-84 Jul 4, 2022
fcd5dfd
MS: Added copying of unigridd to AppData/Raoming/unigrid/bin for wind…
Fim-84 Jul 4, 2022
eab62e9
ignore fx/templates/
dekm Jul 5, 2022
d8e685b
fix moving of daemon files after untar on linux and osx
dekm Jul 5, 2022
0d166e5
MS: fixing update button in the wallet
Fim-84 Jul 6, 2022
dc14e16
MS: Added config to janus project
Fim-84 Jul 6, 2022
6b3298d
MS: changed path for the config file
Fim-84 Jul 6, 2022
db58d1f
update search location for local daemon (#82)
dekm Jul 6, 2022
e132e35
MS: Changed path for compressed daemon
Fim-84 Jul 6, 2022
3922806
MS: fixed conflicts
Fim-84 Jul 6, 2022
6610a32
fix download location of daemons (#83)
dekm Jul 6, 2022
dabc3a4
ignore config xmls
dekm Jul 6, 2022
9a9719d
ignore config xmls correct folder
dekm Jul 6, 2022
c4dc948
remove configs from repo
dekm Jul 6, 2022
82b9a9c
update config location to new repo
dekm Jul 6, 2022
8505fe5
set correct locations for all OS's when generating the configs
dekm Jul 6, 2022
f2db752
setting locations for configs to new repo
dekm Jul 6, 2022
2183c5b
update the unzip method for windows to copy all execs to bin
dekm Jul 6, 2022
12d2861
update mac directories and mac config location
dekm Jul 6, 2022
98d9203
update unigrid directory names to match the daemon as uppercase
dekm Jul 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/target/
/fx/target/
fx/templates/
/fx/runtime/
/desktop/target/

Expand All @@ -16,3 +17,8 @@ fx/unigrid-cli.exe
fx/unigridd.exe
fx/unigridd
fx/unigrid-cli
/UpdateBootstrap/target/
/updateBootstrapConfig/target/
/config/UpdateWalletConfig/target/
/config/UpdateWalletConfig/config*

40 changes: 40 additions & 0 deletions UpdateBootstrap/nbactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>clean</goal>
<goal>javafx:run</goal>
</goals>
</action>
<action>
<actionName>debug</actionName>
<goals>
<goal>clean</goal>
<goal>javafx:run@ide-debug</goal>
</goals>
<properties>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<goals>
<goal>clean</goal>
<goal>javafx:run@ide-profile</goal>
</goals>
</action>
<action>
<actionName>CUSTOM-jlink</actionName>
<displayName>jlink</displayName>
<goals>
<goal>clean</goal>
<!-- compile not needed with javafx-maven-plugin v0.0.5 -->
<goal>compile</goal>
<goal>javafx:jlink</goal>
</goals>
</action>
</actions>
75 changes: 75 additions & 0 deletions UpdateBootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>parent</artifactId>
<groupId>org.unigrid.janus</groupId>
<version>1.0.6-SNAPSHOT</version>
</parent>
<groupId>org.unigrid</groupId>
<artifactId>UpdateBootstrap</artifactId>
<version>1.0.6-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<mainClass>org.unigrid.updatebootstrap.App</mainClass>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17-ea+7</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>17-ea+7</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17-ea+7</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>17-ea+7</version>
</dependency>
<dependency>
<groupId>org.update4j</groupId>
<artifactId>update4j</artifactId>
<version>1.5.9</version>
</dependency>
<!--<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.3.0-alpha14</version>
</dependency>-->


</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<mainClass>org.unigrid.updatebootstrap.App</mainClass>
<commandlineArgs>--ADD-OPENS=org.update4j</commandlineArgs>
</configuration>
<executions>
<execution>
<!-- Default configuration for running -->
<!-- Usage: mvn clean javafx:run -->
<id>default-cli</id>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
21 changes: 21 additions & 0 deletions UpdateBootstrap/src/main/java/org/unigrid/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module org.unigrid.updatebootstrap {
requires javafx.controls;
requires javafx.fxml;
requires java.base;
requires org.update4j;
requires java.instrument;
requires java.sql;
requires jdk.security.auth;
requires transitive java.xml;
requires jdk.zipfs;
requires java.compiler;
requires jdk.crypto.ec;
//requires org.slf4j;
//requires ch.qos.logback.classic;

opens org.unigrid.updatebootstrap to javafx.fxml, org.update4j;
opens org.unigrid.updatebootstrap.controllers to javafx.fxml;

exports org.unigrid.updatebootstrap to org.update4j, javafx.graphics;
exports org.unigrid.updatebootstrap.controllers;
}
109 changes: 109 additions & 0 deletions UpdateBootstrap/src/main/java/org/unigrid/updatebootstrap/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
The Janus Wallet
Copyright © 2021 The Unigrid Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the
addended GNU Affero General Public License as published by the Free Software Foundation, version 3
of the License (see COPYING and COPYING.addendum).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received an addended copy of the GNU Affero General Public License with this program.
If not, see <http://www.gnu.org/licenses/> and <https://github.com/unigrid-project/janus-java>.
*/
package org.unigrid.updatebootstrap;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import org.update4j.Configuration;
import org.update4j.service.Delegate;
import org.update4j.OS;
import javafx.stage.StageStyle;
//import ch.qos.logback.classic.Level;
//import ch.qos.logback.classic.Logger;
//import org.slf4j.LoggerFactory;

public class App extends Application implements Delegate {

private static Scene scene;
private static FXMLLoader loader;

@Override
public void start(Stage stage) throws IOException {

//final Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
//root.setLevel(Level.ALL);

stage.setMinWidth(600);
stage.setMinHeight(300);

URL configUrl = null;
OS os = OS.CURRENT;
if (os.equals(OS.LINUX)) {
configUrl = new URL("https://raw.githubusercontent.com/unigrid-project/unigrid-update/main/config-linux.xml");

} else if (os.equals(OS.WINDOWS)) {
configUrl = new URL("https://raw.githubusercontent.com/unigrid-project/unigrid-update/main/config-windows.xml");
} else if (os.equals(OS.MAC)) {
configUrl = new URL("https://raw.githubusercontent.com/unigrid-project/unigrid-update/main/config-windows.xml");
}
//configUrl = new URL("https://raw.githubusercontent.com/Fim-84/test/main/config.xml");
Configuration config = null;

try ( Reader in = new InputStreamReader(configUrl.openStream(), StandardCharsets.UTF_8)) {
System.out.println("are we getting here??????");
config = Configuration.read(in);
} catch (IOException e) {
System.out.println(e.getMessage());
try ( Reader in = Files.newBufferedReader(Paths.get(System.getProperty("user.home"),"/work/janus-java/config/UpdateWalletConfig/config.xml"))) {
//try ( Reader in = Files.newBufferedReader(Paths.get("/home/marcus/Documents/unigrid/config/UpdateWalletConfig/config.xml"))) {
System.out.println("reading local config xml");
config = Configuration.read(in);
}
}

config.sync();
scene = new Scene(loadFXML("updateView"));
stage.initStyle(StageStyle.UNDECORATED);
stage.centerOnScreen();
stage.setResizable(false);
stage.setScene(scene);
stage.show();
UpdateView.getInstance().setConfig(config, stage);

}

static void setRoot(String fxml) throws IOException {
scene.setRoot(loadFXML(fxml));
}

private static Parent loadFXML(String fxml) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
loader = fxmlLoader;
return fxmlLoader.load();
}

public static void main(String[] args) {
launch();
}

@Override
public void main(List<String> list) throws Throwable {
launch();
}

}
Loading