@@ -48,22 +48,27 @@ class InstallerDataService {
4848
4949 if ( ! fs . existsSync ( this . installRoot ) ) {
5050 mkdirp . sync ( path . resolve ( this . installRoot ) ) ;
51- let uninstallerLocation = path . resolve ( this . installRoot , 'unistaller' ) ;
52- Logger . info ( `Data - Create uninstaller in ${ uninstallerLocation } ` ) ;
53- mkdirp . sync ( uninstallerLocation ) ;
54- let uninstallerPs1 = Util . resolveFileLocation ( './uninstaller' , 'uninstall.ps1' ) ;
55- // write file content to uninstaller/uninstaller.ps1
56- fsExtra . copy ( uninstallerPs1 , path . join ( uninstallerLocation , 'uninstall.ps1' ) , ( err ) => {
57- if ( err ) {
58- Logger . error ( 'Data - ' + err ) ;
59- } else {
60- Logger . info ( 'Data - Copy ' + uninstallerPs1 + ' to ' + path . join ( uninstallerLocation , 'uninstall.ps1' ) + ' SUCCESS' ) ;
61- }
62- } ) ;
6351 }
52+ this . copyUninstaller ( ) ;
53+
6454 Logger . initialize ( this . installRoot ) ;
6555 }
6656
57+ copyUninstaller ( ) {
58+ let uninstallerLocation = path . resolve ( this . installRoot , 'unistaller' ) ;
59+ Logger . info ( `Data - Create uninstaller in ${ uninstallerLocation } ` ) ;
60+ mkdirp . sync ( uninstallerLocation ) ;
61+ let uninstallerPs1 = Util . resolveFileLocation ( './uninstaller' , 'uninstall.ps1' ) ;
62+ // write file content to uninstaller/uninstaller.ps1
63+ fsExtra . copy ( uninstallerPs1 , path . join ( uninstallerLocation , 'uninstall.ps1' ) , ( err ) => {
64+ if ( err ) {
65+ Logger . error ( 'Data - ' + err ) ;
66+ } else {
67+ Logger . info ( 'Data - Copy ' + uninstallerPs1 + ' to ' + path . join ( uninstallerLocation , 'uninstall.ps1' ) + ' SUCCESS' ) ;
68+ }
69+ } ) ;
70+ }
71+
6772 addItemToInstall ( key , item ) {
6873 this . installableItems . set ( key , item ) ;
6974 this . toInstall . add ( key ) ;
0 commit comments