I faced unpleasant situation with silent installation of some program. I am not sure that they use any convention for installation flags with values but here what should be used for installation:
"path with spaces\setup.exe" -uninst -s -f2"path with spaces\uninstall.log"
you cannot use --f2="path with spaces\uninstall.log" or -f2="path with spaces\uninstall.log" or -f2 "path with spaces\uninstall.log"
so if I use in Python following:
command = [self.setup_exe, '-uninst', '-s', fr'-f2"{uninstall_log_file}"']
command that subprocess is executing (get from subprocess.list2cmdline(command)) is:
setup.exe" -uninst -s -f2\"some path\temp build 12\uninstall.log\"
basically slashes appear and installation is failing. Theoretically I can create my own string but the same provider for another executable provides another syntax which is more compatible with subprocess. I am wondering if it is possible to setup a list of arguments to satisfy reqs of installer?
shell=Truewhen you shouldn't be.shell=Truejust switches from executing the command directly to running a shell with a constructed argument to have the shell run the command for you.