Hey Fergus,
Sorry, at first I was a bit confused by cx_freeze and uninstall.py, then I realized you were referring to our docs that show how to create an uninstall wrapper…
You are definitely right that the target-dir should be a double-dash, single dash does not work. I’ll be sure to update that.
As for the script itself, here’s a version that has been modified to fix the syntax errors in your copy:
[code]import sys
import subprocess
import string
import re
from time import sleep
def uninstall_running():
process_list_raw = subprocess.check_output([ “C:/Windows/System32/tasklist.exe”, “/FO:csv”] )
re_uninstall = re.compile("^_uninstall[0-9]*$")
for process_line in string.split(process_list_raw, "\n"):
process_name = string.split(string.replace(process_line, "\"", ""), ",")[0]
if re_uninstall.match(process_name):
return 1
return 0
num_args = len(sys.argv)
if num_args <= 1:
print “Error: No command was entered”
exit(1)
args = []
args.append(sys.argv[1])
if num_args >= 2:
for i in range(2, num_args):
args.append(str(sys.argv[i]))
try:
p = subprocess.Popen(args)
p.wait()
except WindowsError:
print “Error: Executable does not exist”
while uninstall_running():
sleep(10)
[/code]
As for the cut-offs in our PDF documentation, I would definitely recommend using the HTML versions of our docs, since those should not have that issue, and would allow for easier copy-pasting.
Cheers,
Jon