Jump to content











Photo
- - - - -

[solved] Does require_file now overwrite existing files?


  • Please log in to reply
48 replies to this topic

#1 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2010 - 08:24 PM

Since when does require_file overwrite existing files?
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. :cheers:

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 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 09 February 2010 - 08:56 PM

You are writing in the App Scripts forum, and I'm sure you know, but for unexperienced members:
"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.

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:'

YES! But that is in the responsibility of the API.

In both cases WinBilder, regardless of the version is not responsible for API's functionality.

'compatible with WB Version:'

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.
Peter

#3 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 09 February 2010 - 09:46 PM

Since when does require_file overwrite existing files?

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.

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 09 February 2010 - 10:04 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]'.

Regards,
Galapo.

Thanks, Galapo.

Your possibility to remember seems to be better than mine :cheers:

Peter

#5 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 09 February 2010 - 11:53 PM

Hi Galapo,

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.

but it was adjusted back.

as far as I remember, it was adjusted back after request(s) from PE2 or PE3 projects due to changes with wb.

maybe better to have a checkbox in api so project admins decide how api works. :cheers:

But I wonder, what you think ? Is there a reason on LiveXP project that needs require_file overwrite ?

#6 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 10 February 2010 - 12:04 AM

Hi Lancelot,

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 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 10 February 2010 - 12:20 AM

Yes I agree, sorry for confusion, I mixed the versions.
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.

;) :cheers:

#8 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 10 February 2010 - 04:47 PM

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.

As i wrote, i couldn't test the current version, because it caused WB to hang with NaughtyPE.
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.

:cheers:

#9 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 10 February 2010 - 10:54 PM

Which WB version is needed with the latest CAPI?

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.

Just to be clear.
- API did not overwrite
- CAPI did overwrite for some versions?

See Lancelot's post below.

- latest CAPI does again not overwrite?

Yes, that's right. Overwriting is done only if specified.

Regards,
Galapo.

#10 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 10 February 2010 - 11:38 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?

:cheers:

#11 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

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 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 10 February 2010 - 11:45 PM

See Lancelot's post below.

I think I should have said "See Lancelot's post above".

#13 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 10 February 2010 - 11:49 PM

Yes I agree, sorry for confusion, I mixed the versions.
v15rev7 does overwrite,

Are you sure, did you mean to say that it doesn't overwrite? PRESERVE parameter is being supplied by default:

[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 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 10 February 2010 - 11:59 PM

I think I should have said "See Lancelot's post above".

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 ! ). ;)

Are you sure, did you mean to say that it doesn't overwrite? PRESERVE parameter is being supplied by default:

I am sure it does overwrite (just rechecked).

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
:cheers:

If you have time, v15rev8 would be nice also fixing
"Syntax was not valid: [CopyOrExpand,#2\#9,#3,#4,#5]"
;)

#15 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 11 February 2010 - 12:13 AM

If you have time, v15rev8 would be nice also fixing
"Syntax was not valid: [CopyOrExpand,#2\#9,#3,#4,#5]"

Do you know what's wrong?

#16 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 11 February 2010 - 12:18 AM

Do you know what's wrong?

I guess since it is a invalid syntax, rest does not work as expected.
maybe (not tested, in 15 minutes...)
CopyOrExpand,#2\#9,#3,#4,#5
should be
CopyOrExpand,#2,#3,#9,#4,#5

#17 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 11 February 2010 - 12:38 AM

CopyOrExpand,#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.

[Variables]

CopyTest=Run,%scriptfile%,CopyTest



[Process]

CopyTest,explorer.exe,%target_win%,PRESERVE



[CopyTest]

CopyOrExpand,%source_win%\#1,#2,#3

Regards,
Galapo.

#18 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 11 February 2010 - 12:51 AM

yes you are right,

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 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 11 February 2010 - 12:57 AM

Can we have similar adjustment for capi v15rev8 boss ?

I guess so, but following all these parameters makes my head hurt!

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 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 11 February 2010 - 01:02 AM

I guess so, but following all these parameters makes my head hurt!

:cheers: ;) I fully understand you.

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 :cheers: )

;)

#21 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 February 2010 - 01:19 PM

CopyOrExpand,#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.

Fixed and uploaded to trash

Peter

#22 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 February 2010 - 08:18 PM

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.

(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?

:cheers:

#23 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 February 2010 - 08:51 PM

Compare with this post:

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)

BTW: nativeEx (and therefore my tests, use CAPI version 22!)

Peter

#24 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 February 2010 - 09:18 PM

My message above was not directed at you, but Lancelot or Galopo, who have fiddled with this special version.

btw. You wouldn't happen to know if CAPIv22 overwrites by default in NativeEx?

:cheers:

#25 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 11 February 2010 - 09:31 PM

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?

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.

Regards,
Galapo.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users