[solved] Does require_file now overwrite existing files?
#1
Posted 09 February 2010 - 08:24 PM
Did run into some strange behaviour in NaughtyPE, which boiled down to the fact, that patched files got replaced by mint versions, because of later require_file commands.
CAPI Version was 8.
Wanted to try the latest version (v.21) but it caused WB to hang.
With all this cross dependencies, i think we need some sort of management system or at least some new fileds in the description tab, for 'compatible with capi version:', 'compatible with WB Version:'
#2
Posted 09 February 2010 - 08:56 PM
"require_file" is an API command, not a WinBuilder command.
API is practically an external app (really a WinBuilder script collection belonging to the project), called from inside some scripts.
API creates one or more WinBuilder commands from the command line which calls API.
YES! But that is in the responsibility of the API.With all this cross dependencies, i think we need some sort of management system
YES! But that is in the responsibility of the API.for 'compatible with capi version:'
In both cases WinBilder, regardless of the version is not responsible for API's functionality.
YES, but that is in the responsibility of the project / script authors. E.g. in native_Ex the Verify script checks WinBuilder version where it is necessary.'compatible with WB Version:'
Peter
#3
Posted 09 February 2010 - 09:46 PM
Nearly always, as far as I'm aware. There was a brief time when it wasn't, but it was adjusted back. Syntax is: 'Require_File,File,%Source_Sys%,%Target_Sys%,[PRESERVE],[NOWARN]'.Since when does require_file overwrite existing files?
Regards,
Galapo.
#4
Posted 09 February 2010 - 10:04 PM
Thanks, Galapo.Nearly always, as far as I'm aware. There was a brief time when it wasn't, but it was adjusted back. Syntax is: 'Require_File,File,%Source_Sys%,%Target_Sys%,[PRESERVE],[NOWARN]'.
Regards,
Galapo.
Your possibility to remember seems to be better than mine
Peter
#5
Posted 09 February 2010 - 11:53 PM
I wrote before better require_file not overwrite for both patching reasons and update reasons. If not than I believe we should move update scripts to the end of process like scripts involving patching.
as far as I remember, it was adjusted back after request(s) from PE2 or PE3 projects due to changes with wb.but it was adjusted back.
maybe better to have a checkbox in api so project admins decide how api works.
But I wonder, what you think ? Is there a reason on LiveXP project that needs require_file overwrite ?
#6
Posted 10 February 2010 - 12:04 AM
I agree with you: it is better if overwriting only occurs if that is explicitly specified. It seems to me now that what I said was back to front, it is as you said.
Now the question is: why is MedEvil using CAPI version 8 still? Better, I think, to discuss the current state of CAPI rather than versions which have been superseded.
Regards,
Galapo.
#7
Posted 10 February 2010 - 12:20 AM
v15rev7 does overwrite,
v21b (aka v22) (and probably also v21) does not overwrite
Better, I think, to discuss the current state of CAPI rather than versions which have been superseded.
#8
Posted 10 February 2010 - 04:47 PM
As i wrote, i couldn't test the current version, because it caused WB to hang with NaughtyPE.Now the question is: why is MedEvil using CAPI version 8 still? Better, I think, to discuss the current state of CAPI rather than versions which have been superseded.
Which WB version is needed with the latest CAPI?
Just to be clear.
- API did not overwrite
- CAPI did overwrite for some versions?
- latest CAPI does again not overwrite?
And for the overwrite / not overwrite discussion. Unless someone comes up with an idea, how to process all app scripts before any of the important scripts, the overwrite is the worst idea possible.
#9
Posted 10 February 2010 - 10:54 PM
078, but LiveXP still uses a modified version 15 which requires 077rc2. Version 15 on the LiveXP is more up-to-date for nativeEx-based projects than current CAPI. Pedro has unfortunately been gone for a while and CAPI requires updating.Which WB version is needed with the latest CAPI?
See Lancelot's post below.Just to be clear.
- API did not overwrite
- CAPI did overwrite for some versions?
Yes, that's right. Overwriting is done only if specified.- latest CAPI does again not overwrite?
Regards,
Galapo.
#10
Posted 10 February 2010 - 11:38 PM
#11
Posted 10 February 2010 - 11:39 PM
If the LiveXP v15 is the best to use a.t.m. question is, how does this version react? Overwirte or no overwrite by default?
See Lancelot's post below.
#12
Posted 10 February 2010 - 11:45 PM
I think I should have said "See Lancelot's post above".See Lancelot's post below.
#13
Posted 10 February 2010 - 11:49 PM
Are you sure, did you mean to say that it doesn't overwrite? PRESERVE parameter is being supplied by default:Yes I agree, sorry for confusion, I mixed the versions.
v15rev7 does overwrite,
[Expand_file1] //Syntax==> Require_File,[Folder\]filename,[Source (if different of %Source_Sys%)],[Target(If different of %Target_Sys%)],[OverWrite]|[PRESERVE],[NOWARN],[MUI Source (if different of parameter #2)] Echo,"Copy or Expand #1" If,%arch%,Equal,x86,If,Not,%SourceArch%,Equal,x86,Begin StrFormat,filename,%target_win%,%SystemRootFolderName% If,Not,%SystemRootFolderName%,Equal,SysWOW64,Begin Set,%source_win%,%SourceDir%\I386 Set,%source_sys%,%SourceDir%\I386 Set,%target_win%,%TargetDir%\%SystemRootFolderName%\SysWOW64 Set,%target_sys%,%TargetDir%\%SystemRootFolderName%\SysWOW64 End End If,Not,#6,Equal,,If,Not,%CopyMui%,Equal,On,Set,#9,#6 Else,Begin StrFormat,filename,#1,#9 If,%arch%,Equal,x86,If,%SourceArch%,Equal,x64,Set,#9,w#9 End StrFormat,path,#1,#8 If,|#2#3#4|,Equal,||,Run,%API%,Expand_1,#1,%Source_Sys%,%Target_Sys%,PRESERVE,#5,#6,#7,#8,#9 Else,Run,%API%,Expand_2,#1,#2,#3,#4,#5,#6,#7,#8,#9 [Expand_1] StrFormat,CTRIM,#3\#8,\,#3 If,%arch%,Equal,x86,If,%SourceArch%,Equal,x64,set,#3,#3\#1 CopyOrExpand,#2\#9,#3,#4,#5 If,%CopyMui%,Equal,On,Run,%API%,CopyMui_On,#1,#2,#3,#4,#5,#6,#7,#8,#9 [Expand_2] If,#4,Equal,,Set,#4,PRESERVE If,#4,Equal,OverWrite,Set,#4,"" If,#2,Equal,,Set,#2,%Source_Sys% If,#3,Equal,,Set,#3,%Target_Sys% Else,StrFormat,CTRIM,#3,\,#3 StrFormat,EXT,#2,%ext% StrFormat,CTRIM,#3\#8,\,#3 If,Not,%ext%,Equal,,Expand,#2,#3,#9,#4 Else,Begin CopyOrExpand,#2\#9,#3,#4,#5 If,%CopyMui%,Equal,On,Run,%API%,CopyMui_On,#1,#2,#3,#4,#5,#6,#7,#8,#9 End
Regards,
Galapo.
#14
Posted 10 February 2010 - 11:59 PM
yes I know, but it is not hard to understand the mistake and change vector to look right direction (if it was not read before ! ).I think I should have said "See Lancelot's post above".
I am sure it does overwrite (just rechecked).Are you sure, did you mean to say that it doesn't overwrite? PRESERVE parameter is being supplied by default:
my test routine:
I put explorer.exe from 2k3 with md5: A26C39540F8BE3729846E360E2C57344 to \Target\LiveXP\I386\System32\
I use "require_file,explorer.exe" at codebox
explorer.exe overwritten with md5: A0732187050030AE399B241436565E64
If you have time, v15rev8 would be nice also fixing
"Syntax was not valid: [CopyOrExpand,#2\#9,#3,#4,#5]"
#15
Posted 11 February 2010 - 12:13 AM
Do you know what's wrong?If you have time, v15rev8 would be nice also fixing
"Syntax was not valid: [CopyOrExpand,#2\#9,#3,#4,#5]"
#16
Posted 11 February 2010 - 12:18 AM
I guess since it is a invalid syntax, rest does not work as expected.Do you know what's wrong?
maybe (not tested, in 15 minutes...)
CopyOrExpand,#2\#9,#3,#4,#5
should be
CopyOrExpand,#2,#3,#9,#4,#5
#17
Posted 11 February 2010 - 12:38 AM
CopyOrExpand,#2\#9,#3,#4 produces an error (#4 being set as PRESERVE).
CopyOrExpand,#2\#9,#3,PRESERVE produces no error
Conclusion: bug with WB.
[Variables] CopyTest=Run,%scriptfile%,CopyTest [Process] CopyTest,explorer.exe,%target_win%,PRESERVE [CopyTest] CopyOrExpand,%source_win%\#1,#2,#3
Regards,
Galapo.
#18
Posted 11 February 2010 - 12:51 AM
I guess pedrole already noticed that too, with all available combinations splitted all [Expand sections into 6 different sections with capi v21 , following v21b here are lines
[Expand_] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9 [Expand_PRESERVE] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9,PRESERVE [Expand_OVERWRITE] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9 [Expand_PRESERVENOWARN] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9,PRESERVE,NOWARN [Expand_OVERWRITENOWARN] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9,NOWARN [Expand_NOWARNPRESERVE] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9,NOWARN,PRESERVE [Expand_NOWARNOVERWRITE] StrFormat,CTRIM,#3\#8,\,#3 Expand,#2,#3,#9,NOWARN
Can we have similar adjustment for capi v15rev8 boss ?
#19
Posted 11 February 2010 - 12:57 AM
I guess so, but following all these parameters makes my head hurt!Can we have similar adjustment for capi v15rev8 boss ?
I do it a bit later some time when I can concentrate more. Or maybe if Peter fixes the bug and LiveXP can use 080 soon then we mightn't have to worry.
Regards,
Galapo.
#20
Posted 11 February 2010 - 01:02 AM
I fully understand you.I guess so, but following all these parameters makes my head hurt!
Besides, currently it is not urgent to fix this for LiveXP, so you can keep head cool for now. Since I already have notes to fix/add things (minor things) I will also give this a try with other (none critical) things I find (tomorrow). (now it is time to hurt my head )
#21
Posted 11 February 2010 - 01:19 PM
Fixed and uploaded to trashCopyOrExpand,#2\#9,#3 produces no error.
CopyOrExpand,#2\#9,#3,#4 produces an error (#4 being set as PRESERVE).
CopyOrExpand,#2\#9,#3,PRESERVE produces no error
Conclusion: bug with WB.
Peter
#22
Posted 11 February 2010 - 08:18 PM
Result: Files get still overwritten.
Every CopyOrExpand command get's loged as syntax error.
(Common_api.script) Syntax was not valid: [CopyOrExpand,#2\#9,#3,#4,#5]
Do i have to change the setup for CAPIv15 compared to CAPIv8 in the script.project?
#23
Posted 11 February 2010 - 08:51 PM
BTW: nativeEx (and therefore my tests, use CAPI version 22!)This is accepted as correct:
[process] Run,%ScriptFile%,bla,ACLUI.DLL,%source_sys%,%target_win%,NOWARN,PRESERVE [bla] CopyOrExpand,#2\#1,#3,#4,#5
If one of the arguments #4 or #5 is different from NOWARN or PRESERVE, the syntax warning comes up.
(I do not know what the API delivers)
Peter
#24
Posted 11 February 2010 - 09:18 PM
btw. You wouldn't happen to know if CAPIv22 overwrites by default in NativeEx?
#25
Posted 11 February 2010 - 09:31 PM
CAPI still needs a slight adjustment. #5 isn't defined most of the time, so WB throws an error because a null parameter is being specified.Did make a test run with the Trash and CAPIv15 from LiveXP server.
Result: Files get still overwritten.
Every CopyOrExpand command get's loged as syntax error.
Do i have to change the setup for CAPIv15 compared to CAPIv8 in the script.project?
Regards,
Galapo.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users