This repository has been archived by the owner on Feb 4, 2018. It is now read-only.
forked from zsxsoft/danmu-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.ps1
53 lines (49 loc) · 2.03 KB
/
pack.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$script:arch = $null;
$script:target = '1.3.2';
$script:platform = $null;
Function DeleteUselessFiles() {
Get-ChildItem ./out | ForEach-Object -Process {
if ($_ -is [System.IO.DirectoryInfo]) {
Remove-Item -Path ./out/$_/locales -Recurse
# Remove-Item -Path ./out/$_/resources/default_app.asar
# Remove-Item -Path ./out/$_/pdf.dll
Remove-Item -Path ./out/$_/version
Remove-Item -Path ./out/$_/LICENSE
# Remove-Item -Path ./out/$_/xinput1_3.dll
# Remove-Item -Path ./out/$_/d3dcompiler_47.dll
# Remove-Item -Path ./out/$_/vccorlib120.dll
Copy-Item -Path ./config.js -Destination ./out/$_/
}
}
}
Function BuildElectron($platform, $arch) {
$script:platform = $platform
$script:arch = $arch
RebuildModule 'electron-penetrate'
RebuildModule 'windows-caption-color'
electron-packager ./ danmu-client `
--asar `
--overwrite `
--icon=danmu.ico `
--app-version=1.0.7 `
--out="./out" `
--ignore="""\.(pdb|exp|lib|map|obj|tlog|vcxproj|gypi|sln|md|log|bin)$|out|node-gyp|nw|nw-.*|.git""" `
--arch=$script:arch --platform=$script:platform --version=$script:target `
--version-string.ProductName="DANMU Client" `
--version-string.CompanyName="zsx (http://www.zsxsoft.com)" `
--version-string.OriginalFilename="danmu-client.exe" `
--version-string.FileVersion="1.0.7" `
--version-string.InternalName="DANMU Client" `
--version-string.FileDescription="DANMU" `
--version-string.LegalCopyright="https://github.com/zsxsoft/danmu-client/"
}
Function RebuildModule($module) {
Write-Host 'Building' $module
cd node_modules/$module
node-gyp rebuild --arch=$script:arch --platform=$script:platform --target=$script:target --dist-url=https://atom.io/download/atom-shell --msvs_version=2015
cd ../../
Write-Host $module "successful built!"
}
BuildElectron 'win32' 'ia32'
BuildElectron 'win32' 'x64'
DeleteUselessFiles