Install SolarPuTTY when available

This commit is contained in:
ziajka 2019-02-04 11:29:39 +01:00
parent 72d0323783
commit b98b607614
5 changed files with 28 additions and 6 deletions

3
.gitignore vendored
View File

@ -55,3 +55,6 @@ licenses.csv
# Temps
.temp-var-file.ts
# external software
/external

View File

@ -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) {
const softwarePath = path.join(app.getPath('temp'), software.binary);
const softwarePath = await getSoftwareInstallationPath(software);
const responseChannel = `installed-software-installed-${software.name}`;
if (software.type == 'web') {

View File

@ -30,21 +30,24 @@ export class ExternalSoftwareDefinitionService {
binary: 'Wireshark.exe',
sudo: true,
installation_arguments: [],
installed: false
installed: false,
installer: true
}
];
const solarPutty = {
name: 'SolarPuTTY',
locations: [
'SolarPuTTY.exe'
'SolarPuTTY.exe',
'external\\SolarPuTTY.exe'
],
type: 'web',
resource: '',
binary: 'SolarPuTTY.exe',
sudo: false,
installation_arguments: ['--only-ask'],
installed: false
installed: false,
installer: false
};
if(environment.solarputty_download_url) {

View File

@ -1,5 +1,5 @@
export const environment = {
solarputty_download_url: "",
solarputty_download_url: '',
production: true,
electron: true,
};

View File

@ -1,5 +1,5 @@
export const environment = {
production: false,
electron: true,
solarputty_download_url: ""
solarputty_download_url: '',
};