diff --git a/direct/src/p3d/pdeploy.py b/direct/src/p3d/pdeploy.py
index 8b98111899..4172544567 100644
--- a/direct/src/p3d/pdeploy.py
+++ b/direct/src/p3d/pdeploy.py
@@ -186,12 +186,12 @@ if not appFilename.exists():
print 'Application filename does not exist!'
sys.exit(1)
-if shortname.lower() != shortname or ' ' in shortname:
- print '\nProvided short name should be lowercase, and may not contain spaces!\n'
-
if shortname == '':
shortname = appFilename.getBasenameWoExtension()
+if shortname.lower() != shortname or ' ' in shortname:
+ print '\nProvided short name should be lowercase, and may not contain spaces!\n'
+
if fullname == '':
fullname = shortname
@@ -251,16 +251,36 @@ elif deploy_mode == 'installer':
i.build(output, platform)
elif deploy_mode == 'html':
+ w, h = tokens.get("width", 640), tokens.get("height", 480)
+ if "data" not in tokens:
+ tokens["data"] = appFilename.getBasename()
+
print "Creating %s.html..." % shortname
- html = open(shortname + ".html", "w")
- html.write("\n")
- html.write("