Skip to content

Commit

Permalink
Added windows icons
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed Nov 6, 2023
1 parent c9c23b8 commit 15d844a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ugs-platform/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@
<property name="bundle.jvm.path" refid="jre_name" />
<basename property="bundle.jvm.name" file="${bundle.jvm.path}"/>

<!-- Delete windows binaries -->
<delete file="${project.build.directory}/${brandingToken}-win/bin/ugsplatform64.exe" failonerror="false"/>
<delete file="${project.build.directory}/${brandingToken}-win/bin/ugsplatform" failonerror="false"/>

<!-- Configure relative JRE path into ugsplatform.conf -->
<replace file="${project.build.directory}/${brandingToken}-win/etc/${brandingToken}.conf" token="#jdkhome=&quot;/path/to/jdk&quot;" value="jdkhome=&quot;jdk/${bundle.jvm.name}&quot;"/>

Expand Down Expand Up @@ -385,6 +389,10 @@
<property name="bundle.jvm.path" refid="jre_name" />
<basename property="bundle.jvm.name" file="${bundle.jvm.path}"/>

<!-- Delete windows binaries -->
<delete file="${project.build.directory}/${brandingToken}-win/bin/ugsplatform.exe" failonerror="false"/>
<delete file="${project.build.directory}/${brandingToken}-win/bin/ugsplatform" failonerror="false"/>

<!-- Configure relative JRE path into ugsplatform.conf -->
<replace file="${project.build.directory}/${brandingToken}-win/etc/${brandingToken}.conf" token="#jdkhome=&quot;/path/to/jdk&quot;" value="jdkhome=&quot;jdk/${bundle.jvm.name}&quot;"/>

Expand Down
Binary file modified ugs-platform/application/src/main/app-resources/icon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,19 @@ public void actionPerformed(ActionEvent e) {

private static void createWindowsShortcut() {
try {
String shortcutPath = System.getProperty("user.home") + File.separator + "Desktop";
String shortcutPath = System.getProperty("user.home") + File.separator + "Desktop" + File.separator + "Universal Gcode Sender.lnk";
Path currentRelativePath = Paths.get("");
String ugsDirectory = currentRelativePath.toAbsolutePath().toString();

ShellLink.createLink("c:\\" + ugsDirectory + File.separator + "ugsplatform.bat")
.setWorkingDir(ugsDirectory)
.setIconLocation(ugsDirectory + File.separator + "icon.ico")
.setTarget(shortcutPath)
.saveTo("Universal Gcode Sender.lnk");
String basePath = currentRelativePath.toAbsolutePath() + File.separator + "bin" + File.separator;
String executablePath = basePath + "ugsplatform64.exe";
if (!new File(executablePath).exists()) {
executablePath = basePath + "ugsplatform.exe";
}

ShellLink.createLink(executablePath)
.setWorkingDir(currentRelativePath.toAbsolutePath().toString())
.setIconLocation(basePath + "icon.ico")
.saveTo(shortcutPath);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 15d844a

Please sign in to comment.