gpt4all/cmake/installerscript.qs

44 lines
1.8 KiB
Plaintext
Raw Normal View History

function Component()
{
// default constructor
}
Component.prototype.createOperations = function()
{
try {
// call the base create operations function
component.createOperations();
if (systemInfo.productType === "windows") {
try {
var userProfile = installer.environmentVariable("USERPROFILE");
installer.setValue("UserProfile", userProfile);
component.addOperation("CreateShortcut",
"@TargetDir@/bin/chat.exe",
2023-04-13 16:01:31 +00:00
"@UserProfile@/Desktop/GPT4All.lnk",
"workingDirectory=@TargetDir@/bin",
2023-04-13 10:55:00 +00:00
"iconPath=@TargetDir@/favicon.ico",
2023-04-13 16:01:31 +00:00
"iconId=0", "description=Open GPT4All Chat");
} catch (e) {
print("ERROR: creating desktop shortcut" + e);
}
component.addOperation("CreateShortcut",
"@TargetDir@/bin/chat.exe",
2023-04-13 16:01:31 +00:00
"@StartMenuDir@/GPT4All.lnk",
"workingDirectory=@TargetDir@/bin",
2023-04-13 10:55:00 +00:00
"iconPath=@TargetDir@/favicon.ico",
2023-04-13 16:01:31 +00:00
"iconId=0", "description=Open GPT4All Chat");
} else if (systemInfo.productType === "osx") {
} else { // linux
2023-04-13 02:12:01 +00:00
component.addOperation("CreateDesktopEntry",
"/usr/share/applications/GPT4AllChat.desktop",
"Type=Application\nTerminal=false\nExec=\"@TargetDir@/bin/chat\"\nName=GPT4All-Chat\nIcon=@TargetDir@/logo-48.png\nName[en_US]=GPT4All-Chat");
2023-04-13 02:12:01 +00:00
component.addElevatedOperation("Copy",
"/usr/share/applications/GPT4AllChat.desktop",
"@HomeDir@/Desktop/GPT4AllChat.desktop");
}
} catch (e) {
print("ERROR: creating desktop/startmenu shortcuts" + e);
}
2023-04-13 10:55:00 +00:00
}