gpt4all/cmake/installerscript.qs

43 lines
1.7 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@/chat.exe",
"@UserProfile@/Desktop/chat.lnk",
"workingDirectory=@TargetDir@",
2023-04-13 02:12:01 +00:00
"iconPath=@TargetDir@/logo-48.png",
"iconId=2", "description=Open GPT4All Chat");
} catch (e) {
print("ERROR: creating desktop shortcut" + e);
}
component.addOperation("CreateShortcut",
"@TargetDir@/chat.exe",
"@StartMenuDir@/chat.lnk",
"workingDirectory=@TargetDir@",
2023-04-13 02:12:01 +00:00
"iconPath=@TargetDir@/logo-48.png",
"iconId=2", "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");
component.addElevatedOperation("Copy",
"/usr/share/applications/GPT4AllChat.desktop",
"@HomeDir@/Desktop/GPT4AllChat.desktop");
}
} catch (e) {
print("ERROR: creating desktop/startmenu shortcuts" + e);
}
}