|
@@ -1,68 +1,69 @@
|
|
|
-/*
|
|
|
- * Copyright (C) 2015 iZc
|
|
|
- *
|
|
|
- * This program is free software: you can redistribute it and/or modify
|
|
|
- * it under the terms of the GNU General Public License as published by
|
|
|
- * the Free Software Foundation, either version 3 of the License, or
|
|
|
- * (at your option) any later version.
|
|
|
- *
|
|
|
- * 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 General Public License for more details.
|
|
|
- *
|
|
|
- * You should have received a copy of the GNU General Public License
|
|
|
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
- */
|
|
|
-package de.nplusc.izc.iZpl.Utils;
|
|
|
-
|
|
|
-import de.nplusc.izc.iZpl.API.IZPLApi;
|
|
|
-import java.awt.Desktop;
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileWriter;
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-/**
|
|
|
- *
|
|
|
- * @author iZc <nplusc.de>
|
|
|
- */
|
|
|
-public class Utilities
|
|
|
-{
|
|
|
- public static void registerFileExtensions()
|
|
|
- {
|
|
|
- String extensionPath = (IZPLApi.APPDIR+File.separator+"bin"+File.separator+"iZpl.bat").replace("\\", "\\\\");
|
|
|
- String iconMain=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izpl.ico,0").replace("\\", "\\\\");
|
|
|
- String iconResume=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izplresume.ico,0").replace("\\", "\\\\");
|
|
|
- String regPatternPlayList="Windows Registry Editor Version 5.00\n" +
|
|
|
- "\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\shell\\open\\command]\n" +
|
|
|
- "@=\"cmd.exe /D /C "+extensionPath+" --file \\\"%1\\\"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izpl]\n" +
|
|
|
- "@=\"izplaylist.playlist\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\DefaultIcon]\n" +
|
|
|
- "@=\""+iconMain+"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\shell\\open\\command]\n" +
|
|
|
- "@=\"cmd.exe /D /C "+extensionPath+" --resume \\\"%1\\\"\"\n" +
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izcont]\n" +
|
|
|
- "@=\"izplaylist.resumefile\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\.izcontinue]\n" +
|
|
|
- "@=\"izplaylist.resumefile\"\n"+
|
|
|
- "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\DefaultIcon]\n" + // nicht die Software\\Classes\\ kkomponente im pfad vergesse.!!!
|
|
|
- "@=\""+iconResume+"\"";
|
|
|
- //regedit /fickDich
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- new File(IZPLApi.APPDIR+File.separator+"res").mkdirs();
|
|
|
- FileWriter fw = new FileWriter(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
- fw.write(regPatternPlayList);
|
|
|
- fw.flush();
|
|
|
- fw.close();
|
|
|
- Desktop.getDesktop().open(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
- }
|
|
|
- catch (IOException ex)
|
|
|
- {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+/*
|
|
|
+ * Copyright (C) 2015 iZc
|
|
|
+ *
|
|
|
+ * This program is free software: you can redistribute it and/or modify
|
|
|
+ * it under the terms of the GNU General Public License as published by
|
|
|
+ * the Free Software Foundation, either version 3 of the License, or
|
|
|
+ * (at your option) any later version.
|
|
|
+ *
|
|
|
+ * 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 General Public License for more details.
|
|
|
+ *
|
|
|
+ * You should have received a copy of the GNU General Public License
|
|
|
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
+ */
|
|
|
+package de.nplusc.izc.iZpl.Utils;
|
|
|
+
|
|
|
+import de.nplusc.izc.iZpl.API.IZPLApi;
|
|
|
+import java.awt.Desktop;
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileWriter;
|
|
|
+import java.io.IOException;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author iZc <nplusc.de>
|
|
|
+ */
|
|
|
+public class Utilities
|
|
|
+{
|
|
|
+ public static void registerFileExtensions()
|
|
|
+ {
|
|
|
+ String launcherPath = (IZPLApi.APPDIR+File.separator+"bin"+File.separator+"iZpl.bat").replace("\\", "\\\\");
|
|
|
+ String silencerStubPath = (IZPLApi.APPDIR+File.separator+"bin"+File.separator+"silent.vbs").replace("\\", "\\\\");
|
|
|
+ String iconMain=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izpl.ico,0").replace("\\", "\\\\");
|
|
|
+ String iconResume=(IZPLApi.APPDIR+File.separator+"res"+File.separator+"izplresume.ico,0").replace("\\", "\\\\");
|
|
|
+ String regPatternPlayList="Windows Registry Editor Version 5.00\n" +
|
|
|
+ "\n" +
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\shell\\open\\command]\n" +
|
|
|
+ "@=\"wscript "+silencerStubPath+" cmd.exe /D /C "+launcherPath+" --file \\\"%1\\\"\"\n" +
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\.izpl]\n" +
|
|
|
+ "@=\"izplaylist.playlist\"\n"+
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.playlist\\DefaultIcon]\n" +
|
|
|
+ "@=\""+iconMain+"\"\n" +
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\shell\\open\\command]\n" +
|
|
|
+ "@=\"wscript "+silencerStubPath+" cmd.exe /D /C "+launcherPath+" --resume \\\"%1\\\"\"\n" +
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\.izcont]\n" +
|
|
|
+ "@=\"izplaylist.resumefile\"\n"+
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\.izcontinue]\n" +
|
|
|
+ "@=\"izplaylist.resumefile\"\n"+
|
|
|
+ "[HKEY_CURRENT_USER\\Software\\Classes\\izplaylist.resumefile\\DefaultIcon]\n" + // nicht die Software\\Classes\\ kkomponente im pfad vergesse.!!!
|
|
|
+ "@=\""+iconResume+"\"";
|
|
|
+ //regedit /fickDich
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ new File(IZPLApi.APPDIR+File.separator+"res").mkdirs();
|
|
|
+ FileWriter fw = new FileWriter(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
+ fw.write(regPatternPlayList);
|
|
|
+ fw.flush();
|
|
|
+ fw.close();
|
|
|
+ Desktop.getDesktop().open(new File(IZPLApi.APPDIR+File.separator+"res"+File.separator+"fileexts.reg"));
|
|
|
+ }
|
|
|
+ catch (IOException ex)
|
|
|
+ {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|