@@ -105,19 +105,19 @@ public Task<bool> ExecuteAsync()
105105 Console . WriteLine ( "Start npm install..." ) ;
106106 ProcessHelper . CmdExecute ( "npm install --production" , tempPath ) ;
107107
108- Console . WriteLine ( "Start npm install electron-packager ..." ) ;
108+ Console . WriteLine ( "Start npm install electron-builder ..." ) ;
109109
110110 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
111111
112112 {
113113 // Works proper on Windows...
114- ProcessHelper . CmdExecute ( "npm install electron-packager --global" , tempPath ) ;
114+ ProcessHelper . CmdExecute ( "npm install electron-builder --global" , tempPath ) ;
115115 }
116116 else
117117 {
118118 // ToDo: find another solution or document it proper
119119 // GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48
120- Console . WriteLine ( "Electron Packager - make sure you invoke 'sudo npm install electron-packager --global' at " + tempPath + " manually. Sry." ) ;
120+ Console . WriteLine ( "Electron Builder - make sure you invoke 'sudo npm install electron-builder --global' at " + tempPath + " manually. Sry." ) ;
121121 }
122122
123123 Console . WriteLine ( "ElectronHostHook handling started..." ) ;
@@ -132,9 +132,11 @@ public Task<bool> ExecuteAsync()
132132 Console . WriteLine ( "Start npm install for hosthooks..." ) ;
133133 ProcessHelper . CmdExecute ( "npm install --production" , hosthookDir ) ;
134134
135- string tscPath = Path . Combine ( tempPath , "node_modules" , ".bin" ) ;
135+ // ToDo: Global TypeScript installation is needed for ElectronHostHook
136+ //string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
137+
136138 // ToDo: Not sure if this runs under linux/macos
137- ProcessHelper . CmdExecute ( @"tsc -p ../../ElectronHostHook --sourceMap false" , tscPath ) ;
139+ ProcessHelper . CmdExecute ( @"tsc -p . --sourceMap false" , hosthookDir ) ;
138140 }
139141
140142 Console . WriteLine ( "Build Electron Desktop Application..." ) ;
@@ -166,15 +168,17 @@ public Task<bool> ExecuteAsync()
166168 electronParams = parser . Arguments [ _paramElectronParams ] [ 0 ] ;
167169 }
168170
171+ // ToDo: Make the same thing easer with native c# - we can save a tmp file in production code :)
172+ Console . WriteLine ( "Create electron-builder configuration file..." ) ;
173+ ProcessHelper . CmdExecute ( $ "node build-helper.js", tempPath ) ;
174+
169175 Console . WriteLine ( $ "Package Electron App for Platform { platformInfo . ElectronPackerPlatform } ...") ;
170- ProcessHelper . CmdExecute ( $ "electron-packager . --platform={ platformInfo . ElectronPackerPlatform } --arch={ electronArch } { electronParams } --out= \" { buildPath } \" --overwrite ", tempPath ) ;
176+ ProcessHelper . CmdExecute ( $ "electron-builder . --config=./bin/electron-builder.json -- platform={ platformInfo . ElectronPackerPlatform } --arch={ electronArch } { electronParams } ", tempPath ) ;
171177
172178 Console . WriteLine ( "... done" ) ;
173179
174180 return true ;
175181 } ) ;
176182 }
177-
178-
179183 }
180184}
0 commit comments