diff --git a/Source/build.cpp b/Source/build.cpp index 23484094..d34f67df 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -3216,8 +3216,8 @@ again: // GetTempFileName $0 ret=add_entry_direct(EW_GETTEMPFILENAME, var_zero, add_string("$TEMP")); if (ret != PS_OK) return ret; - // Delete $0 - the temp file created - ret=add_entry_direct(EW_DELETEFILE, zero_offset); + // Delete $0 [simple, nothing that could clash with special temp permissions] + ret=add_entry_direct(EW_DELETEFILE, zero_offset, DEL_SIMPLE); if (ret != PS_OK) return ret; // CraeteDirectory $0 - a dir instead of that temp file ret=add_entry_direct(EW_CREATEDIR, zero_offset); diff --git a/Source/exehead/fileform.h b/Source/exehead/fileform.h index 9f1b7b45..3e741ea1 100644 --- a/Source/exehead/fileform.h +++ b/Source/exehead/fileform.h @@ -442,6 +442,7 @@ typedef struct { #define DEL_DIR 1 #define DEL_RECURSE 2 #define DEL_REBOOT 4 +#define DEL_SIMPLE 8 // $0..$9, $INSTDIR, etc are encoded as ASCII bytes starting from this value. // Added by ramon 3 jun 2003 diff --git a/Source/exehead/util.c b/Source/exehead/util.c index ef81acc1..ac150b3e 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -103,6 +103,12 @@ void NSISCALL myDelete(char *buf, int flags) char *fn; int valid_dir=is_valid_instpath(buf); + if ((flags & DEL_SIMPLE)) + { + g_exec_flags.exec_error += !DeleteFile(buf); + return; + } + #ifdef NSIS_SUPPORT_RMDIR if (!(flags & DEL_DIR) || (valid_dir && (flags & DEL_RECURSE))) #endif//NSIS_SUPPORT_RMDIR