i am using a File command to copy directory from source and destination. I cannot use a copy.
it works for now. but when if any file is locked, it fails. anyways to improve this
!macro ExtractDirectory dest source asterisk recursive
SetOverwrite on
${LogIt} "ExtractDirectory from: $\"${source}\${asterisk}$\" to $\"${dest}$\" recursive: $\"${recursive}$\""
#RMDir /r ${dest}
SetOutPath ${dest}
ClearErrors
${If} ${recursive} == "true"
File /r `${source}\${asterisk}`
${Else}
File `${source}\${asterisk}`
${EndIf}
${If} ${Errors}
${LogReportAbort} "ExtractDirectory: from: ${source} failed..." "ExtractDirectory: from: ${source} failed..."
${EndIf}
!macroend
extract files during install
12 posts
Is it the source or destination that is locked?
Fails how? Does it display a message?
Fails how? Does it display a message?
I am not able to identify that. I am extracting 2 directories and in between my install fails with onInstFailed action. I can see in logs first one is completed and prior to starting of the second one, I see installation fail or aborted message.
If it does not fail in makensis then it is not the source.
This will display a dialog when not running in silent mode:
This will display a dialog when not running in silent mode:
Section
InitPluginsDir
FileOpen $1 "$PluginsDir\test.txt" w ; Lock file
ExecShell "" "cmd.exe" '/C ping -n 99 localhost&del "$PluginsDir\test.txt"&rmdir "$PluginsDir"' SW_HIDE ; Cleanup hack
SetOverwrite on
File "/oname=$PluginsDir\test.txt" "${__FILE__}"
SectionEnd it's not at source..it is the destination
Does you get a error dialog or not? Are you running in silent mode?
It's a silent install and even in UI it exits without a proper message. It shows onInstFailed message, but bit extract failed. not the ideal situation to be in
Does my example display a retry dialog when not silent?
We have no idea what your macros like LogReportAbort are doing...
We have no idea what your macros like LogReportAbort are doing...
Abort writes the error message onto the log and quits the installer.
?...Originally Posted by Anders View PostDoes my example display a retry dialog when not silent?
yes it does
Then there is a bug with /r or something strange happening with your macros.
Using ${if} on a macro parameter is not really something you should be doing when !if might work instead.
Using ${if} on a macro parameter is not really something you should be doing when !if might work instead.