Skip to content

Commit b00f200

Browse files
authored
Merge pull request #33 from fa0311/develop-v4
update v4.3.0
2 parents 1752d58 + a9e05e3 commit b00f200

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

DMMGamePlayerFastLauncher.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import json
55
import glob
66
import win32crypt
7+
import ctypes
78
import random
89
import hashlib
910
import sqlite3
@@ -58,6 +59,7 @@ def get_dpg5_config(dgp5_path):
5859
argpar.add_argument("--login-force", action="store_true")
5960
argpar.add_argument("--skip-exception", action="store_true")
6061
argpar.add_argument("--https-proxy-uri", default=None)
62+
argpar.add_argument("--non-request-admin", action="store_true")
6163
arg = argpar.parse_args()
6264

6365
HEADERS = {
@@ -160,7 +162,6 @@ def get_dpg5_config(dgp5_path):
160162
verify=False,
161163
proxies=PROXY,
162164
).json()
163-
print(response)
164165
if response["result_code"] == 100:
165166
dmm_args = response["data"]["execute_args"].split(" ")
166167
start_time = time.time()
@@ -171,7 +172,18 @@ def get_dpg5_config(dgp5_path):
171172
text = line.decode("utf-8").strip()
172173
print(text)
173174
if time.time() - start_time < 2 and not arg.skip_exception:
174-
raise Exception("ゲームが起動しませんでした。ゲームにアップデートがある可能性があります。")
175+
if response["data"]["is_administrator"] and not arg.non_request_admin:
176+
if not ctypes.windll.shell32.IsUserAnAdmin():
177+
ctypes.windll.shell32.ShellExecuteW(
178+
None, "runas", game_path, response["data"]["execute_args"], None, 1
179+
)
180+
else:
181+
raise Exception("ゲームが起動しませんでした。管理者権限を許可してください。")
182+
elif response["data"]["is_administrator"]:
183+
raise Exception("ゲームが起動しませんでした。管理者権限を許可してください。")
184+
else:
185+
if not arg.skip_exception:
186+
raise Exception("ゲームが起動しませんでした。ゲームにアップデートがある可能性があります。")
175187
elif response["result_code"] == 801:
176188
if not arg.skip_exception:
177189
raise Exception("日本国外からのアクセスは禁止されています\n" + json.dumps(response))

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
4242
| --login-force | | False | ログインを強制する | bool |
4343
| --skip-exception | | False | エラーをスキップ | bool |
4444
| --https-proxy-uri | | None | HTTPSプロキシを指定 | string |
45+
| --non-request-admin | | False | 管理者権限が必要な際にリクエストしない | bool |
4546

4647
## ヘルプ
4748

@@ -105,6 +106,10 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
105106
> **「指定されたファイルが見つかりません」というエラーが出る**<br>
106107
> `--game-path` で指定したゲームのパスが間違っています<br>
107108
109+
> **管理者権限が要求され起動しないかつエラーが出ない**<br>
110+
> そのゲームには対応していません<br>
111+
> IssueやTwitterでバグ報告お願いします<br>
112+
108113
### 何もしてないのに壊れた!!ってとき
109114

110115
> **「ログインに失敗しました」というエラーが出る**<br>
@@ -113,6 +118,8 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
113118
114119
> **「ゲームが起動しませんでした」というエラーが出る**<br>
115120
> ゲームにアップデートがないか確認して下さい<br>
121+
> 管理者権限を与えてみてください<br>
122+
> それでも解決しなければIssueやTwitterでバグ報告お願いします<br>
116123
117124
> **「起動にエラーが発生したため修復プログラムを実行しました」というエラーが出る**<br>
118125
> まれに表示される場合は正常な動作です<br>
@@ -142,6 +149,9 @@ DMM Game Player のゲームを高速かつセキュアに起動できるラン
142149
> DMMGamePlayerのバグ(仕様?)です<br>
143150
> どうすることも出来ないので頻繁にDMMGamePlayerを起動する方にこのツールはオススメしません<br>
144151
152+
> **なぜか管理者権限が要求される**<br>
153+
> ゲームによっては要求されたりされなかったりします<br>
154+
145155
## 典拠
146156
[Lutwidse/priconner_launch.py](https://gist.github.com/Lutwidse/82d8e7a20c96296bc0318f1cb6bf26ee)
147157

setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "DMMGamePlayerFastLauncher"
5-
#define MyAppVersion "4.2.2"
5+
#define MyAppVersion "4.3.0"
66
#define MyAppPublisher "yuki"
77
#define MyAppURL "https://github.com/fa0311/DMMGamePlayerFastLauncher"
88
#define MyAppExeName "DMMGamePlayerFastLauncher.exe"

0 commit comments

Comments
 (0)