Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #28

Merged
merged 2 commits into from
Jun 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions angelica.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
import winreg
import zipfile
import shutil
import tkinter.simpledialog as simpledialog
import ctypes
from ctypes.wintypes import MAX_PATH

from os.path import join as __
from tkinter import messagebox

Expand Down Expand Up @@ -190,23 +194,16 @@ def all_uninstaller(uninstall_info_list):


def get_my_documents_folder():
# レジストリを見て、探す
try:
my_documents_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")
except OSError:
raise Exception(_("ERR_NOT_FIND_MY_DOCUMENTS"))

try:
my_documents_path, key_type = winreg.QueryValueEx(my_documents_key, "Personal")
except FileNotFoundError:
raise Exception(_("ERR_NOT_FIND_MY_DOCUMENTS_IN_REGKEY"))

return my_documents_path
# APIを使って探す
buf = ctypes.create_unicode_buffer(MAX_PATH + 1)
if ctypes.windll.shell32.SHGetSpecialFolderPathW(None, buf, 0x0005, False):
return buf.value
else:
raise Exception(_("ERR_SHGetSpecialFolderPathW"))


def mod_installer(app_id, target_repository, key_file_name, game_dir_name, key_list_url):
# My Documents をレジストリから見つける
# My Documents をAPIから見つける
install_game_dir_path = __(get_my_documents_folder(),
"Paradox Interactive",
game_dir_name)
Expand Down