mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
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",
|
|
"@UserProfile@/Desktop/GPT4All.lnk",
|
|
"workingDirectory=@TargetDir@/bin",
|
|
"iconPath=@TargetDir@/favicon.ico",
|
|
"iconId=0", "description=Open GPT4All Chat");
|
|
} catch (e) {
|
|
print("ERROR: creating desktop shortcut" + e);
|
|
}
|
|
component.addOperation("CreateShortcut",
|
|
"@TargetDir@/bin/chat.exe",
|
|
"@StartMenuDir@/GPT4All.lnk",
|
|
"workingDirectory=@TargetDir@/bin",
|
|
"iconPath=@TargetDir@/favicon.ico",
|
|
"iconId=0", "description=Open GPT4All Chat");
|
|
} else if (systemInfo.productType === "osx") {
|
|
} else { // linux
|
|
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);
|
|
}
|
|
}
|