Skip to content

Commit e7fb00c

Browse files
committed
JBDS-4518 Installer creates multiple uninstallers for one location
1 parent e6a70ed commit e7fb00c

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

browser/services/data.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
import Logger from './logger';
44
import Platform from '../services/platform';
55
import loadMetadata from '../services/metadata';
6-
let os = require('os');
7-
let path = require('path');
8-
let fs = require('fs');
9-
let fsExtra = require('fs-extra');
10-
let electron = require('electron');
11-
let mkdirp = require('mkdirp');
12-
let pify = require('pify');
13-
let child_process = require('child_process');
6+
import os from 'os';
7+
import path from 'path';
8+
import fs from 'fs';
9+
import fsExtra from 'fs-extra';
10+
import electron from 'electron';
11+
import mkdirp from 'mkdirp';
12+
import pify from 'pify';
13+
import child_process from'child_process';
14+
1415

1516
class InstallerDataService {
1617
constructor($state, requirements = require('../../requirements.json'), packageConf = require('../../package.json')) {
@@ -196,7 +197,7 @@ class InstallerDataService {
196197
return appDataPath ? path.join(appDataPath, '..', 'Local', 'RedHat', 'DevSuite') : this.tempDir();
197198
}, darwin: ()=> {
198199
let homePath = Platform.ENV.HOME;
199-
return homePath ? path.join(homePath , 'Library', 'Application Support', 'RedHat', 'DevSuite') : this.tempDir();
200+
return homePath ? path.join(homePath, 'Library', 'Application Support', 'RedHat', 'DevSuite') : this.tempDir();
200201
}, default: ()=> {
201202
return this.tempDir();
202203
}

uninstaller/create-uninstaller.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ $uninstallIcon = "$targetLocation\uninstaller\uninstall.ico"
99
$uninstallString = "powershell -ExecutionPolicy ByPass -File $targetLocation\uninstaller\uninstall.ps1 $timeStamp"
1010
$installDate = Get-Date -Format yyyyMMdd
1111

12+
Get-ChildItem $uninstallItem | where-object { ($_.PSChildName -like "DevelopmentSuite*" -and (Get-ItemProperty -Path $_.PSPath -Name InstallLocation).InstallLocation -like "$targetLocation") } | ForEach-Object {Remove-Item -Path $_.PSPath }
13+
1214
New-Item -Path "$uninstallItem" -Name "DevelopmentSuite$timeStamp"
1315
New-ItemProperty -Path $devsuiteItem -Name DisplayName -Value "Red Hat Development Suite"
1416
New-ItemProperty -Path $devsuiteItem -Name DisplayVersion -Value $versionString

0 commit comments

Comments
 (0)