[Windows] Add option to add programm to autostart
parent
6e25ffd730
commit
9a0e00f474
|
@ -360,9 +360,10 @@ public class InstallConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Linux] Creates an auto start for your GUI application that will be started directly after the window manager was loaded
|
* Creates an auto start entry for your GUI application that will be started directly after the window manager
|
||||||
|
* / the desktop was loaded
|
||||||
*
|
*
|
||||||
* @param user User for which the GUI should be started
|
* @param user [Linux] User for which the GUI should be started. This information is only required for linux
|
||||||
* @param startFlags Execution flags to add to the launch script like "--minimized"
|
* @param startFlags Execution flags to add to the launch script like "--minimized"
|
||||||
*/
|
*/
|
||||||
public void createGuiAutostart(String user, String startFlags) {
|
public void createGuiAutostart(String user, String startFlags) {
|
||||||
|
|
|
@ -299,8 +299,23 @@ public class Installer {
|
||||||
|
|
||||||
// Creates a Link that the program can be launched from everywhere //
|
// Creates a Link that the program can be launched from everywhere //
|
||||||
this.createLauncher("", "", true);
|
this.createLauncher("", "", true);
|
||||||
// create also an link for the %PATH% variable
|
|
||||||
if (conf.createPathVariable) this.createLauncher("", conf.getApplicationDir() + "path/" + conf.getApplicationNameShort() + ".bat", true);
|
// Create also an link for the %PATH% variable
|
||||||
|
if (conf.createPathVariable) {
|
||||||
|
this.createLauncher("", conf.getApplicationDir() + "path/" + conf.getApplicationNameShort() + ".bat", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a GUI auto start file //
|
||||||
|
if (conf.createGuiAutostart) {
|
||||||
|
String pathMenu = "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\" + conf.getApplicationNameShort() + ".lnk";
|
||||||
|
|
||||||
|
// Create an autostart file only for the current user
|
||||||
|
if (conf.getIsUser()) {
|
||||||
|
pathMenu = System.getenv("APPDATA") + "\\Microsoft\\Windows\\Start Menu\\Programs\\Autostart\\" + conf.getApplicationNameShort() + ".lnk";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.createDesktopShortcut(pathMenu, conf.guiAutostartFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// in the first step a desktop shortcut will be created //
|
// in the first step a desktop shortcut will be created //
|
||||||
|
|
Loading…
Reference in New Issue