Debian Codegraph @

deploy/installer/gui/installscript.qs

raw
1 function Component()
2 {
3 }
4
5 Component.prototype.createOperations = function()
6 {
7 component.createOperations();
8
9 try
10 {
11 if( installer.value("os") === "win" )
12 {
13 /**
14 * Start Menu Shortcut
15 */
16 component.addOperation( "CreateShortcut", "@TargetDir@\\nheko.exe", "@StartMenuDir@\\nheko.lnk",
17 "workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\nheko.exe",
18 "iconId=0", "description=Desktop client for the Matrix protocol");
19
20 /**
21 * Desktop Shortcut
22 */
23 component.addOperation( "CreateShortcut", "@TargetDir@\\nheko.exe", "@DesktopDir@\\nheko.lnk",
24 "workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\nheko.exe",
25 "iconId=0", "description=Desktop client for the Matrix protocol");
26
27 var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe";
28 var key= "HKEY_CLASSES_ROOT\\matrix";
29 component.addOperation("Execute", reg, "ADD", key, "/f", "/t", "REG_SZ", "/d", "URL:Matrix Protocol");
30 component.addOperation("Execute", reg, "ADD", key, "/f", "/v", "URL Protocol", "/t", "REG_SZ");
31 var iconkey = "HKEY_CLASSES_ROOT\\matrix\\DefaultIcon";
32 component.addOperation("Execute", reg, "ADD", iconkey, "/f", "/t", "REG_SZ", "/d", "@TargetDir@\\nheko.exe,1");
33 component.addOperation("Execute", reg, "ADD", "HKEY_CLASSES_ROOT\\matrix\\shell", "/f");
34 component.addOperation("Execute", reg, "ADD", "HKEY_CLASSES_ROOT\\matrix\\shell\\open", "/f");
35 var commandkey = "HKEY_CLASSES_ROOT\\matrix\\shell\\open\\command"
36 component.addOperation("Execute", reg, "ADD", commandkey, "/f");
37 component.addOperation("Execute", reg, "ADD", commandkey, "/f", "/t", "REG_SZ", "/d", "\"@TargetDir@\\nheko.exe\" \"%1\"");
38 }
39 }
40 catch( e )
41 {
42 print( e );
43 }
44 }