Topic: FileCopy copies more than asked  (Read 5023 times)

FileCopy copies more than asked
« on: May 10, 2013, 05:38:09 PM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309
This line:

FileCopy,"%ScriptDir%\folderA\*.dll","%a_dir%"

Will copy any *.dll from folderA, which is OK, but if a subfolder of folderA exists, for example folderA\folderB, and if folderB contains any .dll file the instruction above will create folderB too with its all .dll folder inside.

In other words:
FileCopy,"%ScriptDir%\folderA\*.dll","%a_dir%" =FileCopy,"%ScriptDir%\folderA\*.dll","%a_dir%" + FileCopy,"%ScriptDir%\folderA\folderB\*.dll","%a_dir%\folderB"

Is this behaviour by design or is it a bug?  :unsure:

Regards

Re: FileCopy copies more than asked
« Reply #1 on: May 10, 2013, 06:19:32 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
it is a "bug" design of winbuilder  (naturally) :wink: , not related to "Macro Library"

they "workaround" this "bug" design by adding norec  ( no recursive ) = (means no subfolder) switch.

shortly try this:
FileCopy,%ScriptDir%\folderA\*.dll,%a_dir%,norec

edit:
besides,
 If you can listen my advice,
  never use folders under project directory (like %ScriptDir%) to provide files or file operations,
   there are many many things that gives headache in time with such usage,
    as a result you can not see any plugins you find distributed here doing such things....
« Last Edit: May 10, 2013, 06:22:39 PM by Lancelot »

Re: FileCopy copies more than asked
« Reply #2 on: May 10, 2013, 07:03:13 PM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309
I will try the norec switch.
I'am used to the old pebuilder  way, what I write are winbuilder.inf scripts or pebuilder.script plugins  :tongue:

BTW,   I can upload a wmplayer.script (actually mpc-hc.exe renamed wmplayer.exe) for win8pe_se if you or anybody else wants to convert it to the redistributable syntax.
It is a nice plugin, it was not easy to fool Windows 8 to accept a fake wmplayer, including things such as the right context menu option Play


Thanks Lancelot

Re: FileCopy copies more than asked
« Reply #3 on: May 10, 2013, 07:50:54 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
BTW,   I can upload a wmplayer.script (actually mpc-hc.exe renamed wmplayer.exe) for win8pe_se if you or anybody else wants to convert it to the redistributable syntax.

I believe better Pm this stuff to Chris, he knows Win8PE SE  :wink:


I'am used to the old pebuilder  way
I fully understand you,
 I did exact same in very past  :thumbsup:
Even tried to make winbuilder.inf scripts to use on both sides (pebuilder-wb), and tried to get .inf work properly by trying to convince developers (pre-historic yet another deafness event) .... but all failed (not satifactory) and I decide to rewrite .. (well I kept my old pebuilder in my archive, but since than never used again...)

In fact, to me, in a perfect world, a new builder better have ability to use pebuilder infs directly (instead of convert), but sadly none of 2 other builders can do such thing   :embarrassed:



Anyway, I had made (spending looots of time..) "Plugin Creator Packed" (Utils\PC Packed)
to ease creating plugins,
 which I hope will also help transfering pebuilder plugins side by side easly (fastly) create new nice plugins  :thumbsup:
on pebuilder plugin cases, since pebuilder use folders,
 --> hit "Enable 'point folder'" button ,
 ----->  than point folder (hit button Right near the box ;))
 --------->  put a "ProgramExe" entry
 ------------>   hit "Gooo"

For most portable applications nothing to do more  :wink: => you can create hundereds of such application plugins in a day  :wink:

And for a new start of a more sophisticated app plugin, still a good , tidy head start  :thumbsup:
 rest is editing new plugin adding minor things like registry, requirements etc. (where I had put some guidance lines at codes to help etc...).

I hope you find useful  :great:

:ymca:

Re: FileCopy copies more than asked
« Reply #4 on: May 10, 2013, 10:17:06 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Pebuilder, ubcd4win, reatogo remind me some memories, less than you without any doubt :smile:
You can send me without worries your wmplayer.inf plugin, or share it here.
With your XPE shorcuts entries or your wmplayer_nu2menu.xml.

Otherwise, PC Packed is really worth seeing to start on a clean base :thumbsup:

Re: FileCopy copies more than asked
« Reply #5 on: May 11, 2013, 02:48:23 AM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309

Re: FileCopy copies more than asked
« Reply #6 on: May 21, 2013, 10:04:29 PM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309
Sorry,it's me again  :embarrassed:

Any ideas why this two following lines of a script are written in reverse order in win8pe.cfg?

AddPostconfig,oem,#$pSystemRoot#$p\system32\pnputil.exe,-i -a #$pSystemRoot#$p\inf\oem*.inf,3
AddPostconfig,sleep,#$pSystemRoot#$p\system32\sleep.exe,30,4



[postconfig]
hidenowait|sleep|%SystemRoot%\system32\sleep.exe 15
hidewait|oem|%SystemRoot%\system32\pnputil.exe -i -a %SystemRoot%\inf\oem*.inf


Regards

Re: FileCopy copies more than asked
« Reply #7 on: May 22, 2013, 03:13:39 AM »

paraglider

  • Chef
  • ***
  • Date Registered: Mar 2011
  • Posts: 144
Because AddPostconfig does not use the Append option of IniWriteTextLine. See:http://code.google.com/p/winbuilder/wiki/iniwritetextline

Re: FileCopy copies more than asked
« Reply #8 on: May 22, 2013, 07:27:55 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Yes and it is the same thing for the other sections of the config file Win8pe.cfg (ex: AddAutoRun -> AutoRun).
So you have to write them in reverse.

Otherwise, I'm not sure that the StartMode 4=hidenowait is really what you want for the Pause (sleep),
3=hidewait seems more appropriate, if it is really needed ! knowing that pnputil is already launched with hidewait

AddPostconfig,sleep,#$pSystemRoot#$p\system32\sleep.exe,30,4 =>3

Re: FileCopy copies more than asked
« Reply #9 on: May 22, 2013, 08:05:40 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi Oscar,

Addpostconfig syntax (other similars) lost its original meaning looong time ago after JFX made core project 3 years ago without big loader dependency,
 still available following some startup order (JFX ChrisR knows better) and only used on project specific plugins.
  Strickly Reminding, use such things on only project specific plugins, and it will be great if such well written plugins added to project  :thumbsup:

Initial IniWriteTextLine syntax was writing reverse order (unlike designs of rest of the world ;)),
 much much later optional append was added  (which logically should be reverse in normal world),
  caused incompatibilites and never (or very rare) used.
   things with winbuilder does not work as it is written, many stuff are not used or used with workarounds due to incompatibilities  :wink:
edit: paraglider's link where some info exists does not include such things or instructions, many stuff you will find there either does not work as written, or not prefered due incompatibilities, or fullly depricated.... although useful document after such warning...
    When you can not figure out from existing examples/plugins, no need to be sorry, feel free to ask  :thumbsup:

:turtle:
« Last Edit: May 22, 2013, 08:10:57 AM by Lancelot »

Re: FileCopy copies more than asked
« Reply #10 on: May 22, 2013, 01:44:47 PM »

0scar

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jan 2013
  • Posts: 309
Thanks Lancelot

 

Powered by EzPortal