As far as I know, it's possible to merge or add chromedriver.exe with a python script that runs on selenium webdriver using Pyinstaller with reference to this post asked by @Phillip.
Here's my code(python):
# importing packages / modules
import os
import service # This module cannot be installed as it asks for Microsoft Visual C++ 14 to be isntalled on pc
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# Defining required functions that needs to be used again and again
def init_driver():
chrome_path = os.path.join(os.path.dirname(__file__), 'selenium','webdriver','chromedriver.exe')
service = service.Service(chrome_path) # So, this cannot be used to merge it.
path = webdriver.Chrome(service, options=Options())
driver = init_driver()
and the command that was given in cmd:
pyinstaller --noconfirm --onefile --console --icon "path/to/icon.ico" --add-binary "path/to/chrome/driver;./driver" "path/to/the/python/pythonscript.py"