Skip to content

Instantly share code, notes, and snippets.

@fredwangwang
Last active June 29, 2020 05:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredwangwang/679a6e6f7a4d66f4502b66d6d6dc5ca8 to your computer and use it in GitHub Desktop.
Save fredwangwang/679a6e6f7a4d66f4502b66d6d6dc5ca8 to your computer and use it in GitHub Desktop.
Assassin's Creed won't launch when installed on drives other than 'C:\'. Eventually found a working solution here: https://steamcommunity.com/app/582160/discussions/0/1483235412214825118/. This script is basically a automated process for it
import ctypes
import glob
import os
import shutil
import sys
# make sure you are *only* running this script in assasin's creed installation folder!!
# 在运行之前,确保这个文件在刺客信条的安装目录!! 否则可能会破坏其他重要文件
dest_path = 'C:\\ac_sound_files\\'
if sys.version_info[0] < 3:
raise Exception("Must be using Python 3")
def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
def find_all_pck(path):
return map(lambda x: x.replace('\\\\', '\\'), (glob.iglob(path + '/**/*.pck', recursive=True)))
def move_and_link_all_folders_contain_soundfile(base_path: str, dest_path: str):
kdll = ctypes.windll.LoadLibrary("kernel32.dll")
sound_files = find_all_pck(base_path)
for f in sound_files:
if os.path.islink(f):
print(f, 'is already moved')
continue
new_path = os.path.join(dest_path, os.path.relpath(f, base_path))
os.makedirs(os.path.dirname(new_path), exist_ok=True)
print("moving '{}' ---> '{}'".format(f, new_path))
shutil.move(f, new_path)
kdll.CreateSymbolicLinkW(f, new_path, 0)
if __name__ == '__main__':
if is_admin():
dest_path = os.path.join(dest_path, os.path.relpath(os.getcwd(), os.path.join(os.getcwd(), "..")))
print("sound files will be in: '{}'".format(dest_path))
print("在运行之前,确保这个文件在刺客信条的安装目录!! 否则可能会破坏其他重要文件")
print("按确认键继续,关闭窗口退出")
print("make sure you are *only* running this script in assasin's creed installation folder!!")
input("press enter to start, or close the program to stop")
move_and_link_all_folders_contain_soundfile(os.getcwd(), dest_path)
input("press enter to exit...")
else:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, os.path.basename(__file__), None, 1)
@fredwangwang
Copy link
Author

Usage

If you installed AC in a drive other than C:\\, and the game does not launch, you might try this method.

  1. make sure Python3 is installed. If not, click here to install
  2. right-click program link and save it. It will download a python program named fix_assasin_creed_sound_files.py
  3. move the program to the assassin creed installation folder
  4. double click fix_assasin_creed_sound_files.py to run the program [1][2]
  5. have fun

Note:

[1]: If it does not run when double clicking, right click, change Opens with: to python.exe under the Python3 installation path during the first step
[2]: if the program crashes during execution, log out and log back in and try it again. Chance is assassin creed is still running in the background and holding the file.

If it still doesn't work, feel free leave a note here

@fredwangwang
Copy link
Author

使用说明

如果刺客信条安装在C盘以外的地方,并且游戏不能启动,可以尝试这个方法:

  1. 确保安装了Python3,如果没有可以点击这里下载安装make sure Python3 is installed. If not, click [here] to install
  2. 右击程序链接保存。你会得到一个叫 fix_assasin_creed_sound_files.py的Python程序
  3. 移动程序到刺客信条安装根目录
  4. 双击 fix_assasin_creed_sound_files.py运行[1][2]
  5. 愉快的玩游戏

注:

[1]: 如果无法双击运行,右击,修改运行程序至Python3安装目录里的python.exe
[2]: 如果程序运行时闪退,注销重新登陆后再运行。很可能刺客信条仍在后台运行

@cato447
Copy link

cato447 commented Apr 22, 2020

Dude you are a god

@Swarius
Copy link

Swarius commented Jun 29, 2020

Just tried this. Didn't work. Have tried everything under google that I can search for related to this issue and absolutely not 1 thing works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment