Commit 402fcdc7 authored by 神楽坂玲奈's avatar 神楽坂玲奈

custom

parent da462e73
......@@ -31,5 +31,5 @@ unzip -o aria2-1.28.0-win-32bit-build1.zip aria2-1.28.0-win-32bit-build1/aria2c.
mv aria2-1.28.0-win-32bit-build1/aria2c.exe bin
rm -rf aria2-1.28.0-win-32bit-build1 aria2-1.27.1-win-32bit-build1.zip
curl -L 'http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/i686/bsdtar-3.2.1-1-i686.pkg.tar.xz' | tar --strip-components=2 -C bin -Jxf - usr/bin/bsdtar.exe
curl -L 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll
curl -L 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll msys32/usr/bin/sha256sum.exe
```
\ No newline at end of file
......@@ -13,7 +13,7 @@
value="{{currentApp.status.progress}}" max="{{currentApp.status.total}}"></progress>
<div *ngIf="currentApp.status.status==='ready' && (currentApp.id != 'ygopro')">
<button (click)="runApp(currentApp)" type="button" class="btn btn-primary">运行</button>
<button type="button" data-toggle="modal" data-target="#settings-modal" class="btn btn-secondary">设置</button>
<button *ngIf="currentApp.actions.get('custom')" (click)="custom(currentApp)" type="button" class="btn btn-secondary">设置</button>
<!--<button (click)="appsService.browse(currentApp)" type="button" class="btn btn-secondary">游览本地文件</button>-->
<div id="network" *ngIf="currentApp.network && currentApp.network.protocol == 'maotama'">
......@@ -119,51 +119,51 @@
</button>
</div>
<div class="modal fade" id="settings-modal" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{{'settings'|translate}}</h4>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#general"> {{'general'|translate}} </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#updates"> {{'updates'|translate}} </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#local-files"> {{'local files'|translate}} </a>
</li>
</ul>
</div>
<div class="modal-body">
<div class="tab-content">
<div id="general" role="tabpanel" class="tab-pane fade active">
<!--<div class="modal fade" id="settings-modal" tabindex="-1">-->
<!--<div class="modal-dialog" role="document">-->
<!--<div class="modal-content">-->
<!--<div class="modal-header">-->
<!--<button type="button" class="close" data-dismiss="modal" aria-label="Close">-->
<!--<span aria-hidden="true">&times;</span>-->
<!--</button>-->
<!--<h4 class="modal-title">{{'settings'|translate}}</h4>-->
<!--<ul class="nav nav-tabs">-->
<!--<li class="nav-item">-->
<!--<a class="nav-link active" data-toggle="tab" href="#general"> {{'general'|translate}} </a>-->
<!--</li>-->
<!--<li class="nav-item">-->
<!--<a class="nav-link" data-toggle="tab" href="#updates"> {{'updates'|translate}} </a>-->
<!--</li>-->
<!--<li class="nav-item">-->
<!--<a class="nav-link" data-toggle="tab" href="#local-files"> {{'local files'|translate}} </a>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<!--<div class="modal-body">-->
<!--<div class="tab-content">-->
<!--<div id="general" role="tabpanel" class="tab-pane fade active">-->
</div>
<div id="updates" role="tabpanel" class="tab-pane fade">
<!--</div>-->
<!--<div id="updates" role="tabpanel" class="tab-pane fade">-->
</div>
<div id="local-files" role="tabpanel" class="tab-pane fade">
<div class="list-inline">
<button type="button" [disabled]="!currentApp.isInstalled()" (click)="uninstall()">
{{'uninstall'|translate}}
</button>
<i *ngIf="uninstalling" class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
</div>
<div>
<!--</div>-->
<!--<div id="local-files" role="tabpanel" class="tab-pane fade">-->
<!--<div class="list-inline">-->
<!--<button type="button" [disabled]="!currentApp.isInstalled()" (click)="uninstall()">-->
<!--{{'uninstall'|translate}}-->
<!--</button>-->
<!--<i *ngIf="uninstalling" class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>-->
<!--<span class="sr-only">Loading...</span>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div>-->
</div>
</div>
</div>
</div><!-- Modal -->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>&lt;!&ndash; Modal &ndash;&gt;-->
<div class="modal fade" id="install-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
*ngIf="installConfig">
<div class="modal-dialog" role="document">
......
......@@ -42,7 +42,7 @@ export class AppDetailComponent implements OnInit {
}
get libraries(): string[] {
return this.settingsService.getLibraries().map((item)=>item.path);
return this.settingsService.getLibraries().map((item) => item.path);
}
get news() {
......@@ -97,7 +97,7 @@ export class AppDetailComponent implements OnInit {
let options = this.installConfig;
let dependencies = currentApp.findDependencies();
let apps = dependencies.concat(currentApp).filter((app)=>!app.isInstalled());
let apps = dependencies.concat(currentApp).filter((app) => !app.isInstalled());
for (let reference of options.references) {
if (reference.install) {
......@@ -110,24 +110,24 @@ export class AppDetailComponent implements OnInit {
try {
let downloadApps = await this.downloadService.addUris(apps, downloadPath);
this.downloadService.getProgress(currentApp)
.subscribe((progress)=> {
.subscribe((progress) => {
currentApp.status.status = "downloading";
currentApp.status.progress = progress.progress;
currentApp.status.total = progress.total;
this.ref.detectChanges();
},
(error)=> {
(error) => {
},
()=> {
() => {
// 避免安装过快
if (currentApp.status.status === "downloading") {
currentApp.status.status = "waiting";
this.ref.detectChanges();
}
});
await Promise.all(downloadApps.map((app)=> {
await Promise.all(downloadApps.map((app) => {
return this.downloadService.getComplete(app)
.then((completeApp: App)=> {
.then((completeApp: App) => {
return this.installService.add(completeApp, options);
});
}));
......@@ -152,6 +152,10 @@ export class AppDetailComponent implements OnInit {
this.appsService.runApp(app);
}
custom(app: App) {
this.appsService.runApp(app, 'custom');
}
copy(text) {
clipboard.writeText(text);
}
......
......@@ -122,21 +122,28 @@ export class AppsService {
return children;
}
async runApp(app: App) {
async runApp(app: App, action_name='main') {
let children = this.findChildren(app);
let cwd = (<AppLocal>app.local).path;
let action: Action = <Action>app.actions.get('main');
let action: Action = <Action>app.actions.get(action_name);
let args: string[] = [];
let env = {};
for (let child of children) {
if (child.isInstalled()) {
let _action = child.actions.get('main');
let _action = child.actions.get(action_name);
if (_action) {
action = _action
}
}
}
let execute = path.join(cwd, action.execute);
if(app.id == 'th123'){
let th105 = <App>app.references.get('th105');
if(th105.isInstalled()){
const config_file = path.join((<AppLocal>app.local).path, 'np21nt.ini');
}
}
if (action.open) {
let np2 = <App>action.open;
let openAction: Action;
......@@ -173,14 +180,13 @@ export class AppsService {
args = args.concat(openAction.args);
let wine = <App>openAction.open;
openPath = (<AppLocal>wine.local).path;
openAction = <Action>(<App>openAction.open).actions.get("main");
openAction = <Action>(<App>openAction.open).actions.get('main');
cwd = (<AppLocal>np2.local).path;
}
args = args.concat(openAction.args);
args.push(action.execute);
execute = path.join(openPath, openAction.execute);
env = Object.assign(env, openAction.env);
}
args = args.concat(action.args);
env = Object.assign(env, action.env);
......
......@@ -37,6 +37,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -47,19 +53,17 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
"network": {
"protocol": "maotama",
"port": 10800,
"servers": [
{
"id": "wudizhanche",
"url": "wss://wudizhanche.mycard.moe:10800"
}
]
},
"version": {
"win32": "1.09",
"darwin": "1.06"
......@@ -114,6 +118,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -124,6 +134,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -170,6 +188,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -180,6 +204,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -226,6 +258,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -236,6 +274,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -282,6 +328,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "config.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -292,6 +344,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "config.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -338,6 +398,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "configCN.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -348,10 +414,19 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "configCN.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
"version": {
"win32": "1.06",
"darwin": "1.06"
},
"news": []
......@@ -394,6 +469,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -404,6 +485,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -450,6 +539,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -460,6 +555,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -506,6 +609,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -516,6 +625,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -562,6 +679,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -572,6 +695,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -618,6 +749,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -628,6 +765,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -674,6 +819,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -684,62 +835,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
"version": {
"darwin": "1.06"
},
"news": []
},
{
"id": "th1",
"name": {
"zh-CN": "东方灵异传"
},
"description": {
"zh-CN": "fxt desc"
},
"category": "game",
"tags": [
"touhou_pc98"
],
"dependencies": {
"win32": [
"np2fmgen"
],
"darwin": [
"np2fmgen"
]
},
"references": {
"win32": [
],
"darwin": [
]
},
"author": "ZUN",
"homepage": "http://www.myacg.cc",
"locales": [
"zh-CN"
],
"actions": {
"win32": {
"main": {
"execute": "th1.hdi",
"args": [],
"env": {
},
"open": "np2fmgen"
}
},
"darwin": {
"main": {
"execute": "th1.hdi",
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"open": "wine",
"env": {
},
"open": "np2fmgen"
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -786,6 +889,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -796,6 +905,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -842,6 +959,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom_chs.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -852,6 +975,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom_chs.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -914,7 +1045,17 @@
"version": {
"darwin": "1.06"
},
"news": []
"news": [],
"network": {
"protocol": "maotama",
"port": 10800,
"servers": [
{
"id": "tiramisu",
"url": "wss://wudizhanche.mycard.moe:10800/"
}
]
}
},
{
"id": "th105-lang-zh-CN",
......@@ -1010,6 +1151,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -1020,6 +1167,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -1066,6 +1221,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom_c.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -1076,6 +1237,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom_c.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -1122,6 +1291,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -1132,6 +1307,14 @@
"env": {
"LANG": "ja_JP.UTF-8"
}
},
"custom": {
"execute": "custom.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "ja_JP.UTF-8"
}
}
}
},
......@@ -1178,6 +1361,12 @@
"args": [],
"env": {
}
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"env": {
}
}
},
"darwin": {
......@@ -1188,6 +1377,14 @@
"env": {
"LANG": "zh_CN.UTF-8"
}
},
"custom": {
"execute": "custom_cn.exe",
"args": [],
"open": "wine",
"env": {
"LANG": "zh_CN.UTF-8"
}
}
}
},
......@@ -1322,6 +1519,62 @@
},
"news": []
},
{
"id": "th1",
"name": {
"zh-CN": "东方灵异传"
},
"description": {
"zh-CN": "fxt desc"
},
"category": "game",
"tags": [
"touhou_pc98"
],
"dependencies": {
"win32": [
"np2fmgen"
],
"darwin": [
"np2fmgen"
]
},
"references": {
"win32": [
],
"darwin": [
]
},
"author": "ZUN",
"homepage": "http://www.myacg.cc",
"locales": [
"zh-CN"
],
"actions": {
"win32": {
"main": {
"execute": "th1.hdi",
"args": [],
"env": {
},
"open": "np2fmgen"
}
},
"darwin": {
"main": {
"execute": "th1.hdi",
"args": [],
"env": {
},
"open": "np2fmgen"
}
}
},
"version": {
"darwin": "1.06"
},
"news": []
},
{
"id": "th2",
"name": {
......
......@@ -39,7 +39,7 @@ install:
- mv aria2-1.28.0-win-32bit-build1/aria2c.exe bin
- rm -rf aria2-1.28.0-win-32bit-build1 aria2-1.27.1-win-32bit-build1.zip
- curl -L 'http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/i686/bsdtar-3.2.1-1-i686.pkg.tar.xz' | tar --strip-components=2 -C bin -Jxf - usr/bin/bsdtar.exe
- curl -L 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll
- curl -L 'http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20161025.tar.xz' | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-lzo2-2.dll msys32/usr/bin/msys-nettle-6.dll msys32/usr/bin/msys-xml2-2.dll msys32/usr/bin/msys-z.dll msys32/usr/bin/sha256sum.exe
- ps: Install-Product node
- npm install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment