![]() |
#1 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
extract files during install
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 |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
Is it the source or destination that is locked?
Fails how? Does it display a message? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
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.
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
If it does not fail in makensis then it is not the source.
This will display a dialog when not running in silent mode: PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
it's not at source..it is the destination
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
Does you get a error dialog or not? Are you running in silent mode?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
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
|
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
Does my example display a retry dialog when not silent?
We have no idea what your macros like LogReportAbort are doing... IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
Abort writes the error message onto the log and quits the installer.
|
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
yes it does
|
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,446
|
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. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|