diff --git a/source/app.d b/source/app.d index 8eb60ac..36d35c7 100644 --- a/source/app.d +++ b/source/app.d @@ -82,6 +82,7 @@ } auto appPath = getcwd(); + string del_exe_file; string appStartScript; Url registryUrl = Url.parse("http://registry.vibed.org/"); logDebug("Using vpm registry url '%s'", registryUrl); @@ -120,6 +121,13 @@ if( cmd == "build" ){ flags ~= "--build-only"; flags ~= "-of"~binName; + } else { + version(Windows){ + import std.random; + auto rnd = to!string(uniform(uint.min, uint.max)) ~ "-"; + del_exe_file = environment.get("TEMP")~"\\.rdmd\\source\\"~rnd~binName; + flags ~= "-of"~del_exe_file; + } } flags ~= "-g"; flags ~= "-I" ~ (vibedDir ~ ".." ~ "source").toNativeString(); @@ -131,7 +139,8 @@ flags ~= (Path("source") ~ appName).toNativeString(); flags ~= args[1 .. $]; - appStartScript = "rdmd " ~ getDflags() ~ " " ~ join(flags, " "); + appStartScript = "rdmd " ~ getDflags() ~ " " ~ join(flags, " ") ~ "\r\n"; + if( del_exe_file.length ) appStartScript ~= "del \""~del_exe_file~"\""; break; case "upgrade": logInfo("Upgrading application in '%s'", appPath); @@ -233,8 +242,7 @@ if(existsFile(Path("source") ~ (vpm.packageName() ~ ".d"))) ret = vpm.packageName(); //Otherwise fallback to source/app.d - else - ret = (Path(".") ~ "app").toNativeString(); + else ret ="app"; version(Windows) { ret ~= ".exe"; } return ret;