Skip to content

Commit b5858a6

Browse files
committed
Added support for Electron 42+
1 parent 58b9ad0 commit b5858a6

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## ElectronNET.Core
44

55
- Fixed slicing of arguments for packaged applications (#1072)
6+
- Added support for Electron 42+ (#1073)
67

78
# 0.5.0
89

src/ElectronNET/build/ElectronNET.LateImport.targets

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<ElectronDirName>.electron</ElectronDirName>
4747
<ElectronSplashScreenFileName Condition="'$(ElectronSplashScreen)' != ''">$([System.IO.Path]::GetFileName($(ElectronSplashScreen)))</ElectronSplashScreenFileName>
4848
<ElectronIconFileName Condition="'$(ElectronIcon)' != ''">$([System.IO.Path]::GetFileName($(ElectronIcon)))</ElectronIconFileName>
49+
<ElectronMajor>$([System.String]::Copy('$(ElectronVersion)').Split('.')[0])</ElectronMajor>
4950
</PropertyGroup>
5051

5152

@@ -363,6 +364,7 @@
363364
<PropertyGroup>
364365
<ElectronOutputPath>$([System.IO.Path]::GetFullPath('$(ElectronOutDir)'))</ElectronOutputPath>
365366
<_NpmCmd>npm install --no-bin-links</_NpmCmd>
367+
<_NpmCmd Condition="$(ElectronMajor) &gt;= 42">npx install-electron</_NpmCmd>
366368
<!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) -->
367369
<_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd>
368370
<_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd>
@@ -376,10 +378,23 @@
376378
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
377379
</Exec>
378380

379-
<!--<Exec Command="powershell -Command &quot;Start-Sleep -Seconds 10&quot;" />-->
380-
381381
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
382382

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) &gt;= 42 AND @(_CopiedFiles->Count()) > 0" />
391+
392+
<Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="600000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="$(ElectronMajor) &gt;= 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+
383398
<!-- Fix up incorrect symlinks created by npm on Windows when targeting macOS -->
384399
<PropertyGroup>
385400
<_ElectronFrameworksDir>$(ElectronOutDir)node_modules\electron\dist\Electron.app\Contents\Frameworks</_ElectronFrameworksDir>

src/ElectronNET/build/ElectronNETRules.Project.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@
436436
<EnumValue Name="40.9.3" DisplayName="40.9.3" />
437437
<EnumValue Name="40.10.0" DisplayName="40.10.0" />
438438
<EnumValue Name="40.10.1" DisplayName="40.10.1" />
439+
<EnumValue Name="40.10.2" DisplayName="40.10.2" />
439440
<EnumValue Name="41.0.0" DisplayName="41.0.0" />
440441
<EnumValue Name="41.0.1" DisplayName="41.0.1" />
441442
<EnumValue Name="41.0.2" DisplayName="41.0.2" />
@@ -454,10 +455,15 @@
454455
<EnumValue Name="41.6.0" DisplayName="41.6.0" />
455456
<EnumValue Name="41.6.1" DisplayName="41.6.1" />
456457
<EnumValue Name="41.7.0" DisplayName="41.7.0" />
458+
<EnumValue Name="41.7.1" DisplayName="41.7.1" />
457459
<EnumValue Name="42.0.0" DisplayName="42.0.0" />
458460
<EnumValue Name="42.0.1" DisplayName="42.0.1" />
459461
<EnumValue Name="42.1.0" DisplayName="42.1.0" />
460462
<EnumValue Name="42.2.0" DisplayName="42.2.0" />
463+
<EnumValue Name="42.3.0" DisplayName="42.3.0" />
464+
<EnumValue Name="42.3.1" DisplayName="42.3.1" />
465+
<EnumValue Name="42.3.2" DisplayName="42.3.2" />
466+
<EnumValue Name="42.3.3" DisplayName="42.3.3" />
461467
</EnumProperty>
462468

463469
<EnumProperty Name="ElectronBuilderVersion"

src/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.5.0</Version>
3+
<Version>0.5.1</Version>
44
<PackageNamePrefix>ElectronNET.Core</PackageNamePrefix>
55
<Authors>Gregor Biswanger, Florian Rappl, softworkz</Authors>
66
<Product>Electron.NET</Product>

0 commit comments

Comments
 (0)