mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-19 21:17:51 +00:00
Install SolarPuTTY when available
This commit is contained in:
parent
72d0323783
commit
b98b607614
3
.gitignore
vendored
3
.gitignore
vendored
@ -55,3 +55,6 @@ licenses.csv
|
|||||||
|
|
||||||
# Temps
|
# Temps
|
||||||
.temp-var-file.ts
|
.temp-var-file.ts
|
||||||
|
|
||||||
|
# external software
|
||||||
|
/external
|
@ -40,8 +40,24 @@ async function downloadFile(resource, softwarePath) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getSoftwareInstallationPath(software) {
|
||||||
|
if (software.installer) {
|
||||||
|
return path.join(app.getPath('temp'), software.binary);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const externalPath = path.join(app.getAppPath(), 'external');
|
||||||
|
const exists = fs.existsSync(externalPath);
|
||||||
|
if (!exists) {
|
||||||
|
fs.mkdirSync(externalPath);
|
||||||
|
}
|
||||||
|
return path.join(externalPath, software.binary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ipcMain.on('installed-software-install', async function (event, software) {
|
ipcMain.on('installed-software-install', async function (event, software) {
|
||||||
const softwarePath = path.join(app.getPath('temp'), software.binary);
|
const softwarePath = await getSoftwareInstallationPath(software);
|
||||||
|
|
||||||
const responseChannel = `installed-software-installed-${software.name}`;
|
const responseChannel = `installed-software-installed-${software.name}`;
|
||||||
|
|
||||||
if (software.type == 'web') {
|
if (software.type == 'web') {
|
||||||
|
@ -30,21 +30,24 @@ export class ExternalSoftwareDefinitionService {
|
|||||||
binary: 'Wireshark.exe',
|
binary: 'Wireshark.exe',
|
||||||
sudo: true,
|
sudo: true,
|
||||||
installation_arguments: [],
|
installation_arguments: [],
|
||||||
installed: false
|
installed: false,
|
||||||
|
installer: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const solarPutty = {
|
const solarPutty = {
|
||||||
name: 'SolarPuTTY',
|
name: 'SolarPuTTY',
|
||||||
locations: [
|
locations: [
|
||||||
'SolarPuTTY.exe'
|
'SolarPuTTY.exe',
|
||||||
|
'external\\SolarPuTTY.exe'
|
||||||
],
|
],
|
||||||
type: 'web',
|
type: 'web',
|
||||||
resource: '',
|
resource: '',
|
||||||
binary: 'SolarPuTTY.exe',
|
binary: 'SolarPuTTY.exe',
|
||||||
sudo: false,
|
sudo: false,
|
||||||
installation_arguments: ['--only-ask'],
|
installation_arguments: ['--only-ask'],
|
||||||
installed: false
|
installed: false,
|
||||||
|
installer: false
|
||||||
};
|
};
|
||||||
|
|
||||||
if(environment.solarputty_download_url) {
|
if(environment.solarputty_download_url) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
solarputty_download_url: "",
|
solarputty_download_url: '',
|
||||||
production: true,
|
production: true,
|
||||||
electron: true,
|
electron: true,
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
electron: true,
|
electron: true,
|
||||||
solarputty_download_url: ""
|
solarputty_download_url: '',
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user