mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
per
This commit is contained in:
parent
5e2119091c
commit
45737adc8b
@ -126,6 +126,20 @@ def checkintegrity():
|
|||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
def checkpermission():
|
||||||
|
from myutils.config import _TR
|
||||||
|
from qtsymbols import QMessageBox
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.makedirs("userconfig", exist_ok=True)
|
||||||
|
except PermissionError:
|
||||||
|
msg = QMessageBox()
|
||||||
|
msg.setText(_TR("权限不足,请以管理员权限运行!"))
|
||||||
|
msg.setWindowTitle(_TR("错误"))
|
||||||
|
msg.exec()
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
def switchdir():
|
def switchdir():
|
||||||
dirname = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
dirname = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
os.chdir(dirname)
|
os.chdir(dirname)
|
||||||
@ -145,5 +159,6 @@ if __name__ == "__main__":
|
|||||||
app.setQuitOnLastWindowClosed(False)
|
app.setQuitOnLastWindowClosed(False)
|
||||||
checklang()
|
checklang()
|
||||||
checkintegrity()
|
checkintegrity()
|
||||||
|
checkpermission()
|
||||||
loadmainui()
|
loadmainui()
|
||||||
app.exit(app.exec())
|
app.exit(app.exec())
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
## 无法启动软件?
|
## 无法启动软件?
|
||||||
|
|
||||||
**1. Error/ModuleNotFoundError**
|
#### **1. Error/ModuleNotFoundError**
|
||||||
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -9,7 +9,13 @@
|
|||||||
<img src="https://image.lunatranslator.xyz/zh/cantstart/1.png">
|
<img src="https://image.lunatranslator.xyz/zh/cantstart/1.png">
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
**2. 找不到重要组件**
|
#### **2. Error/PermissionError**
|
||||||
|
|
||||||
|
如果软件被放到`Program Files`等特殊文件夹,可能会没有读写权限。请使用管理员权限运行。
|
||||||
|
|
||||||
|
<img src="https://image.lunatranslator.xyz/zh/cantstart/6.png" width=400>
|
||||||
|
|
||||||
|
#### **3. 找不到重要组件**
|
||||||
|
|
||||||
<img src="https://image.lunatranslator.xyz/zh/cantstart/2.jpg">
|
<img src="https://image.lunatranslator.xyz/zh/cantstart/2.jpg">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user