|
46 | 46 | <ElectronDirName>.electron</ElectronDirName> |
47 | 47 | <ElectronSplashScreenFileName Condition="'$(ElectronSplashScreen)' != ''">$([System.IO.Path]::GetFileName($(ElectronSplashScreen)))</ElectronSplashScreenFileName> |
48 | 48 | <ElectronIconFileName Condition="'$(ElectronIcon)' != ''">$([System.IO.Path]::GetFileName($(ElectronIcon)))</ElectronIconFileName> |
| 49 | + <ElectronMajor>$([System.String]::Copy('$(ElectronVersion)').Split('.')[0])</ElectronMajor> |
49 | 50 | </PropertyGroup> |
50 | 51 |
|
51 | 52 |
|
|
363 | 364 | <PropertyGroup> |
364 | 365 | <ElectronOutputPath>$([System.IO.Path]::GetFullPath('$(ElectronOutDir)'))</ElectronOutputPath> |
365 | 366 | <_NpmCmd>npm install --no-bin-links</_NpmCmd> |
| 367 | + <_NpmCmd Condition="$(ElectronMajor) >= 42">npx install-electron</_NpmCmd> |
366 | 368 | <!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) --> |
367 | 369 | <_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd> |
368 | 370 | <_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd> |
|
376 | 378 | <Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/> |
377 | 379 | </Exec> |
378 | 380 |
|
379 | | - <!--<Exec Command="powershell -Command "Start-Sleep -Seconds 10"" />--> |
380 | | - |
381 | 381 | <Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" /> |
382 | 382 |
|
| 383 | + <PropertyGroup> |
| 384 | + <_NpmCmd>npx install-electron</_NpmCmd> |
| 385 | + <!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) --> |
| 386 | + <_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd> |
| 387 | + <_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd> |
| 388 | + </PropertyGroup> |
| 389 | + |
| 390 | + <Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="$(ElectronMajor) >= 42 AND @(_CopiedFiles->Count()) > 0" /> |
| 391 | + |
| 392 | + <Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="600000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="$(ElectronMajor) >= 42 AND @(_CopiedFiles->Count()) > 0"> |
| 393 | + <Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/> |
| 394 | + </Exec> |
| 395 | + |
| 396 | + <Message Importance="High" Text="Electron installation failed!" Condition="'$(ExecExitCode)' != '0'" /> |
| 397 | + |
383 | 398 | <!-- Fix up incorrect symlinks created by npm on Windows when targeting macOS --> |
384 | 399 | <PropertyGroup> |
385 | 400 | <_ElectronFrameworksDir>$(ElectronOutDir)node_modules\electron\dist\Electron.app\Contents\Frameworks</_ElectronFrameworksDir> |
|
0 commit comments