WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2d6d4e2

Browse files
committed
Fix up incorrect symlinks created by npm on Windows
1 parent df8e269 commit 2d6d4e2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/ElectronNET/build/ElectronNET.LateImport.targets

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,23 @@
380380

381381
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
382382

383+
<!-- Fix up incorrect symlinks created by npm on Windows when targeting macOS -->
384+
<PropertyGroup>
385+
<_ElectronFrameworksDir>$(ElectronOutDir)node_modules\electron\dist\Electron.app\Contents\Frameworks</_ElectronFrameworksDir>
386+
</PropertyGroup>
387+
388+
<ItemGroup>
389+
<_ElectronFrameworkDirs Include="$(_ElectronFrameworksDir)\Electron Framework.framework" />
390+
<_ElectronFrameworkDirs Include="$(_ElectronFrameworksDir)\Mantle.framework" />
391+
<_ElectronFrameworkDirs Include="$(_ElectronFrameworksDir)\ReactiveObjC.framework" />
392+
<_ElectronFrameworkDirs Include="$(_ElectronFrameworksDir)\Squirrel.framework" />
393+
</ItemGroup>
394+
395+
<!-- Only execute on Windows host when targeting macOS -->
396+
<Message Importance="High" Text="Fixing macOS framework Resources symlinks" Condition="'$(ElectronPlatform)' == 'mac' AND '$(_CurrentOSPlatform)' == 'win'" />
397+
398+
<Exec Command="cmd /c del Resources &amp;&amp; mklink /D Resources &quot;Versions\Current\Resources&quot;" WorkingDirectory="%(_ElectronFrameworkDirs.Identity)" Condition="'$(ElectronPlatform)' == 'mac' AND '$(_CurrentOSPlatform)' == 'win'" />
399+
383400
</Target>
384401

385402
<Target Name="BeforePublishElectronApp" BeforeTargets="PrepareForPublish">

0 commit comments

Comments
 (0)