Heres my solution in python.
make build, then run this script and then make mini_installer build then run this script again and then build your installer and it including everything inside will be signed.
you need to replace:
C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64\\signtool.exe
D:\\Asil\\src\\out\\Component
with your build folder
C:\\Users\\user\\Desktop\\asil-certificate\\new-Halalz (2).pfx
PFX_Password
import os
import datetime
import subprocess
def apply_certificate(file_path, pfx_file, password):
# Command to sign the file with the certificate
signtool= "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64\\signtool.exe"
sign_command = f'"{signtool}" sign /f "{pfx_file}" /p "{password}" "{file_path}"'
print(sign_command)
# Execute the command
subprocess.run(sign_command, shell=True)
def main(directory_path, pfx_file, password):
# Validate if the provided path is a directory
if not os.path.isdir(directory_path):
print(f"The specified path '{directory_path}' is not a directory.")
return
# Loop through each file in the directory
for filename in os.listdir(directory_path):
file_path = os.path.join(directory_path, filename)
# Check if the file is a DLL or EXE
if filename.lower().endswith(('.dll', '.exe')):
# Get the current modified date and time
current_modified_time = datetime.datetime.fromtimestamp(os.path.getmtime(file_path))
print(f"File: {filename}")
print(f"Current Modified Time: {current_modified_time}")
# Apply EV code signing certificate
apply_certificate(file_path, pfx_file, password)
# Set the modified date and time back to what it was before
os.utime(file_path, (current_modified_time.timestamp(), current_modified_time.timestamp()))
print("EV Code Signing Certificate Applied.")
print(f"Modified Time Set to: {current_modified_time}")
print("")
if _name_ == "_main_":
# Specify the directory path
directory_path = "D:\\Asil\\src\\out\\Component"
# Specify the path to the PFX file and its password
pfx_file = "C:\\Users\\user\\Desktop\\asil-certificate\\new-Halalz (2).pfx"
password = "PFX_Password"
# Call the main function
main(directory_path, pfx_file, password)
mini_installer
. But if you want to sign files insidemini_installer
for e.g., chrome.exe chrome.dll etc then you will have to modify the build script and digitally sign files before mini installer is built