diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 50fab5ebe4..5824b4783d 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4641,6 +4641,10 @@ except: ########################################################################################## def MakeInstallerNSIS(file, fullname, smdirectory, installdir): + if (os.path.isfile(file)): + os.remove(file) + elif (os.path.isdir(file)): + shutil.rmtree(file) if (RUNTIME): # Invoke the make_installer script. AddToPathEnv("PATH", GetOutputDir() + "\\bin") @@ -4652,8 +4656,6 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir): print "Building "+fullname+" installer. This can take up to an hour." if (COMPRESSOR != "lzma"): print("Note: you are using zlib, which is faster, but lzma gives better compression.") - if (os.path.exists(file)): - os.remove(file) if (os.path.exists("nsis-output.exe")): os.remove("nsis-output.exe") WriteFile(GetOutputDir()+"/tmp/__init__.py", "")