Jump to content











Photo
* * * * - 3 votes

Adding Files


  • Please log in to reply
49 replies to this topic

#1 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 27 March 2008 - 03:38 PM

I have two image files that I want to add to the xp live cd. I added a script and it works just fine to run my app. But the app asks to browse to the image files on the cd and I would like to put them on there so it is all inclusive install. Sorry I am new to this I have been reading on here for a couple days trying to figure it out. I tried to create a script and add the image files that way but I get out of memory errors on my 2gig box. Thanks

#2 pscEx

pscEx

    Platinum Member

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

Posted 27 March 2008 - 07:16 PM

I have two image files that I want to add to the xp live cd. I added a script and it works just fine to run my app. But the app asks to browse to the image files on the cd and I would like to put them on there so it is all inclusive install. Sorry I am new to this I have been reading on here for a couple days trying to figure it out. I tried to create a script and add the image files that way but I get out of memory errors on my 2gig box. Thanks

Hi flyfishin4trout,

welcome in our forum!

Please allow me (after done) that I moved your post from the 'Tutorials' forum to this forum.

To your question:

In the script you mentioned above, just add some lines to copy the images you need. Because I do not know any paths, allow me to use symbols here, enclosed in <>

FileCopy,<full path to image on your pc>,%TargetDir%\<path on PE where the app tries to find the image, w/o <Drive Letter>:\>
Sample: FileCopy,C:\myProgdata\myApp\image1.jpg,%TargetDir%\common\progdata

Good luck!

Peter

#3 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 28 March 2008 - 03:49 PM

Hi flyfishin4trout,

welcome in our forum!

Please allow me (after done) that I moved your post from the 'Tutorials' forum to this forum.

To your question:

In the script you mentioned above, just add some lines to copy the images you need. Because I do not know any paths, allow me to use symbols here, enclosed in <>

FileCopy,<full path to image on your pc>,%TargetDir%\<path on PE where the app tries to find the image, w/o <Drive Letter>:\>
Sample: FileCopy,C:\myProgdata\myApp\image1.jpg,%TargetDir%\common\progdata

Good luck!

Peter


If I wanted to add the two images into the desktop on the image how would I do that. I cannot figure out the path that the image uses. Thanks for your help. I appreciate it.

#4 pscEx

pscEx

    Platinum Member

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

Posted 28 March 2008 - 06:39 PM

If I wanted to add the two images into the desktop on the image how would I do that. I cannot figure out the path that the image uses. Thanks for your help. I appreciate it.


I assume that you want to have the images as files on desktop, not as wallpaper or similar.

If you have a nativeEx based project like LiveXP or nativeEx_barebone itself, try:
IniRead,%ProjectInfo%,TargetPaths,Desktop,%MyDesktop%

  FileCopy,<full path to image on your pc>,%TargetDir%\%MyDesktop%

Some explanation: In nativeEx based projects the folder names are taken -language dependent- from your source CD.
For quick access, the names are stored in %ProjectInfo%, that is %BaseDir%\Workbench\<project name>\UserData\ProjectInfo.ini.

After Building a CD this file is shortened. Before shortening, a copy of the complete file is in %BaseDir%\Temp\<project name>

Peter

#5 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 29 March 2008 - 01:26 AM

I have two image files that I want to add to the xp live cd. I added a script and it works just fine to run my app. But the app asks to browse to the image files on the cd and I would like to put them on there so it is all inclusive install. Sorry I am new to this I have been reading on here for a couple days trying to figure it out. I tried to create a script and add the image files that way but I get out of memory errors on my 2gig box. Thanks

I want to make sure I understand your question/situation; you have an application which requires some image files (.jpg, .bmp etc.), right? How big are these image files? Have you tried simply including these files, along with any others that your app is dependent on in the script by using this option in WinBuilders Create a new script... tool
addfiles.JPG

You can easily add more than one file by simply highlighting all the files you need (from your desktop or folder etc.), just browse to the location of files on your computer you want to add to the script...
addfiles2.JPG

This will automatically include the files for your program in the correct location (its Program Folder) in your PE build (on the CD).

#6 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 29 March 2008 - 05:30 AM

...
In the script you mentioned above, just add some lines to copy the images you need. Because I do not know any paths, allow me to use symbols here, enclosed in <>

FileCopy,<full path to image on your pc>,%TargetDir%\<path on PE where the app tries to find the image, w/o <Drive Letter>:\>
Sample: FileCopy,C:\myProgdata\myApp\image1.jpg,%TargetDir%\common\progdata

Good luck!

Peter

Hi Peter,

I don't mean to hijack this post or go off topic but... I'm very interested in this idea you have of copying files from a host source to the PE build directory. I have tried implementing without success. Can you give an example of this in a working script for testing? Is it possible to copy all the files in the source folder without calling each one individually or just extract from an sfx.exe source? :thumbsup:

#7 pscEx

pscEx

    Platinum Member

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

Posted 29 March 2008 - 07:48 AM

Hi Peter,

I don't mean to hijack this post or go off topic but... I'm very interested in this idea you have of copying files from a host source to the PE build directory. I have tried implementing without success. Can you give an example of this in a working script for testing? Is it possible to copy all the files in the source folder without calling each one individually or just extract from an sfx.exe source? :thumbsup:


Have a look into the buildModel help.

Copy file or directory:
Run,%BuildModelScript%,Copy-File,"<source symbol >"[,"<target symbol>"]
Preset Application Data sample:
Run,%BuildModelScript%,Copy-File,"@Application_Data\Microsoft\MSN Messenger\*!"
copies the complete MSN Messenger application data with all subdirectories.


Peter

#8 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 30 March 2008 - 05:37 PM

Have a look into the buildModel help.


Peter

Thank you Peter!

Once again you have set me on the right path...
&#91;Process&#93;

Unpack

If,NotExistDir,&#34;%Target_prog%\%ProgramFolder%&#34;,DirMake,&#34;%Target_prog%\%ProgramFolder%&#34;

If,NotExistDir,&#34;%Target_prog%\%ProgramFolder%\Signatures&#34;,DirMake,&#34;%Target_prog%\%ProgramFolder%\Signatures&#34;

If,%pCheckBox1%,Equal,True,Add_Shortcut,Desktop

If,%pCheckBox2%,Equal,True,Add_Shortcut,QuickLaunch

If,%pCheckBox3%,Equal,True,Add_Shortcut,StartMenu

If,%pCheckBox4%,Equal,True,Run,%ScriptFile%,CopyFiles

If,%pCheckBox4%,Equal,False,Run,%ScriptFile%,CopyHost



&#91;Copy&#93;

DirMake,&#34;%pFileBox2%&#34;

FileCopy,&#34;%pFileBox1%\*.*&#34;,&#34;%pFileBox2%&#34;



&#91;CopyFiles&#93;

FileCopy,&#34;%pFileBox2%\*.*&#34;,&#34;%Target_prog%\%ProgramFolder%\Signatures&#34;



&#91;CopyHost&#93;

FileCopy,&#34;%pFileBox1%\*.*&#34;,&#34;%Target_prog%\%ProgramFolder%\Signatures&#34;

This works beautifully for 'injecting' updated virus definitions directly from host installed program or from backup source folder on HDD at build time! I'll be updating the A-Squared script with this option. :thumbsup:

@flyfishin4trout,

Sorry, I know I 'hijacked' your post :tabletalk: This wasn't my intention and I apologize. Please feel free to get us back on track here; now, what was your question again? :D

#9 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 03:44 PM

Im really glad we have lots of posts. That last one seems to be what I am looking for to make this work. I will report back as soon as I test. Sorry I failed to mention that the image files that I am adding are pc images. They are 1.9 gig each and are to reimage pc's. I do a lot of remote support so I want to make a boot dvd that i can just tell them to throw in and do this and bam the pc is reimaged. Thanks again for all your help.

#10 pscEx

pscEx

    Platinum Member

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

Posted 31 March 2008 - 03:48 PM

Sorry I failed to mention that the image files that I am adding are pc images.


Shows once again how important a good description is, especially for native 'non-English' like me.

I thought that you wanted to have *.jpg of your wife, children, dog etc. inside the PE. :thumbsup:

Petere

#11 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 03:55 PM

Shows once again how important a good description is, especially for native 'non-English' like me.

I thought that you wanted to have *.jpg of your wife, children, dog etc. inside the PE. :thumbsup:

Petere


I am not a programmer so I am a little confused with the code.

[Process]
Unpack
If,NotExistDir,"%Target_prog%\%ProgramFolder%",DirMake,"%Target_prog%\%ProgramFolder%"
If,NotExistDir,"%Target_prog%\%ProgramFolder%\Signatures",DirMake,"%Target_prog%\%ProgramFolder%\Signatures"
If,%pCheckBox1%,Equal,True,Add_Shortcut,Desktop
If,%pCheckBox2%,Equal,True,Add_Shortcut,QuickLaunch
If,%pCheckBox3%,Equal,True,Add_Shortcut,StartMenu
If,%pCheckBox4%,Equal,True,Run,%ScriptFile%,CopyFiles
If,%pCheckBox4%,Equal,False,Run,%ScriptFile%,CopyHost

[Copy]
DirMake,"%pFileBox2%"
FileCopy,"%pFileBox1%\*.*","%pFileBox2%"

[CopyFiles]
FileCopy,"%pFileBox2%\*.*","%Target_prog%\%ProgramFolder%\Signatures"

[CopyHost]
FileCopy,"%pFileBox1%\*.*","%Target_prog%\%ProgramFolder%\Signatures"

My directory is c:\images\380base.img
and c:\images\380base.002

I want to copy both of those to the desktop. Sorry but I dont see where to add the code there. Thanks again. Eric

#12 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 31 March 2008 - 04:14 PM

I am not a programmer so I am a little confused with the code.

[Process]
Unpack
If,NotExistDir,"%Target_prog%\%ProgramFolder%",DirMake,"%Target_prog%\%ProgramFolder%"
If,NotExistDir,"%Target_prog%\%ProgramFolder%\Signatures",DirMake,"%Target_prog%\%ProgramFolder%\Signatures"
If,%pCheckBox1%,Equal,True,Add_Shortcut,Desktop
If,%pCheckBox2%,Equal,True,Add_Shortcut,QuickLaunch
If,%pCheckBox3%,Equal,True,Add_Shortcut,StartMenu
If,%pCheckBox4%,Equal,True,Run,%ScriptFile%,CopyFiles
If,%pCheckBox4%,Equal,False,Run,%ScriptFile%,CopyHost

[Copy]
DirMake,"%pFileBox2%"
FileCopy,"%pFileBox1%\*.*","%pFileBox2%"

[CopyFiles]
FileCopy,"%pFileBox2%\*.*","%Target_prog%\%ProgramFolder%\Signatures"

[CopyHost]
FileCopy,"%pFileBox1%\*.*","%Target_prog%\%ProgramFolder%\Signatures"

My directory is c:\images\380base.img
and c:\images\380base.002

I want to copy both of those to the desktop. Sorry but I dont see where to add the code there. Thanks again. Eric

Hi flyfishin4trout,
This is from a script which allows you to choose files on your host machine to include in your build; in this case anti-virus definitions but could be adapted for other needs. Check out the script here and see if you can tell what code does what as represented in the interface :thumbsup:
a2flvstup.JPG

#13 pscEx

pscEx

    Platinum Member

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

Posted 31 March 2008 - 04:17 PM

I am not a programmer so I am a little confused with the code.
...
I want to copy both of those to the desktop. Sorry but I dont see where to add the code there. Thanks again. Eric

Do you want to have the files inside the PE (needs a DVD, perhaps a dual layer DVD) or do you want have a link to the file, maybe to an USB stick?

First option can be solved simply, like I already mentioned some posts ago:

Here again with some comments. I assume a nativeEx based project like nativeEx_barebone or LiveXP, no VistaPE:

Create a new script, using WinBuilder >> Advanced
Delete the lines under [process] and replace by::

Retrieve the PE desktop path in the target. Name is source CD language dependent:
IniRead,%ProjectInfo%,TargetPaths,Desktop,%MyDesktop%
Now copy the file to the destination you just found
FileCopy,<full path to first image on your pc>,%TargetDir%\%MyDesktop%

 FileCopy,<full path to second image on your pc>,%TargetDir%\%MyDesktop%

Give your script a name of your choice, and store it whereever you want (rules where to store and which level are for experts, coming later :thumbsup: )

You should find your new script anywhere in the project tree: Select it for run.

The ISO will contain your PC images on the desktop.

Unfortunately there is an issue now: You cannot test with an emulator, as long as you cannot give about 4 GB of memory to the emulator. So a test can only be done with a real burned DVD.

I'm sure that there is a way around, using a 'mounted' DVD or USB stick.
But that is more complicated (for 'experts' mentioned above) and I do not want to explain the 'how' w/o having tested.

Peter


#14 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 04:35 PM

Thanks for the info! This is the error that I get.


[Info] File [%BaseDir%\Projects\LiveXP\Apps\Rdeploy1.script] Version
[Success] IniRead - [%BaseDir%\Workbench\livexp\UserData\ProjectInfo.ini] Section [TargetPaths] key [Desktop] to variable: [%MyDesktop%] with value []
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
Script time: 1 second and 141 miliseconds

Here is my code
[main]
Title=Rdeploy
Description=my Program description
Selected=True
Level=5
Version=1

[variables]
%ProgramTitle%=myProgram
%ProgramEXE%=myProgram.exe
%ProgramFolder%=myProgramFolder

[process]
IniRead,%ProjectInfo%,TargetPaths,Desktop,%MyDesktop%
FileCopy,<c:\images\380base.img>,%TargetDir%\%MyDesktop%
FileCopy,<c:\images\380base.002>,%TargetDir%\%MyDesktop%

[EncodedFolders]
Folder

#15 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 04:41 PM

Thanks for the info! This is the error that I get.


[Info] File [%BaseDir%\Projects\LiveXP\Apps\Rdeploy1.script] Version
[Success] IniRead - [%BaseDir%\Workbench\livexp\UserData\ProjectInfo.ini] Section [TargetPaths] key [Desktop] to variable: [%MyDesktop%] with value []
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
Script time: 1 second and 141 miliseconds

#16 pscEx

pscEx

    Platinum Member

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

Posted 31 March 2008 - 04:55 PM

Thanks for the info! This is the error that I get.


[Info] File [%BaseDir%\Projects\LiveXP\Apps\Rdeploy1.script] Version
[Success] IniRead - [%BaseDir%\Workbench\livexp\UserData\ProjectInfo.ini] Section [TargetPaths] key [Desktop] to variable: [%MyDesktop%] with value []
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
[Failed] FileCopy - Failed to copy [] to: [%BaseDir%\Target\LiveXP\]
Script time: 1 second and 141 miliseconds

You cannot run the script 'stand alone' it has to be embedded inside a project build.

If you run 'stand alone' the needed values inside %projectinfo% are not defined.

I assume that you do not want to publish your script, because it is your private special.

Therefore you must not be language independent and can use hardcoded values.

I assume that you have English source CD.

So in your special case you can write (compare above)
&#91;process&#93;

 FileCopy,<c&#58;\images\380base.img>,%TargetDir%\$Modelram\Documents and Settings\Default User\Desktop

 FileCopy,<c&#58;\images\380base.002>,%TargetDir%\$Modelram\Documents and Settings\Default User\Desktop

Peter

BTW: This suggestion hurts me personally, because I always proclaim 'language inependence'

#17 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 05:34 PM

I uploaded my project script. I am getting errors trying to run it. Its the winbuilder 74 version. Sorry Im really new at all this. I have been a systems/network admin for 10 years but this scripting stuff has eluded me. Thanks for all your help. I really appreciate it.

#18 flyfishin4trout

flyfishin4trout
  • Members
  • 8 posts
  •  
    United States

Posted 31 March 2008 - 05:42 PM

Here is project

Attached Files



#19 pscEx

pscEx

    Platinum Member

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

Posted 31 March 2008 - 05:46 PM

I uploaded my project script. I am getting errors trying to run it. Its the winbuilder 74 version. Sorry Im really new at all this. I have been a systems/network admin for 10 years but this scripting stuff has eluded me. Thanks for all your help. I really appreciate it.

If you look into my signature 'There are no stupid questions' ...

Tell us (as detailed as possible) what your issues are.

Do not worry to 'waste my time'. I like to help and I'm usually very patient (as long as the poster respects the forum's rules)

I feel proud that until now I brought every user to success, even such difficult candidates like Amalux and Ispy ( :thumbsup: )

Peter

#20 pscEx

pscEx

    Platinum Member

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

Posted 31 March 2008 - 06:00 PM

For me, it's currently the local time telling me to stop for today.

Tomorrow I'll send you a kind of a tutorial including a script which hopefully fullfills your requirements.

Be patient until then.

BTW: The script.project you posted, is ok.

Peter

#21 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 01 April 2008 - 07:25 AM

For me, it's currently the local time telling me to stop for today.

Tomorrow I'll send you a kind of a tutorial including a script which hopefully fullfills your requirements.

Be patient until then.

BTW: The script.project you posted, is ok.

Peter

Hi Peter,

This script works well for normal size files but I can't get it to work with larger files, like HD backup images Attached File  Include_Host_Files.7z   3.67KB   119 downloads
hostfiles.JPG

Computer hangs at building ModelRAM phase. The file is copied to the location below but build never finishes (no log)
hostfilesfail.JPG

#22 pscEx

pscEx

    Platinum Member

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

Posted 01 April 2008 - 08:44 AM

Computer hangs at building ModelRAM phase. The file is copied to the location below but build never finishes (no log)

It is an issue of 7z.
I tried and got the following:
7z.gif
7z uses all cpu and memory ressources. but it is working!
The size of ModelRAM.exe is increasing continously.

So maybe after several hours it would be completed.

But when thinking about the stuff again, a complete modelram.exe would not help.
It has to be expanded into a 4 GB RAM disk. And how build a 4GB RAM disk in my 1 GB RAM?

Peter

#23 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 01 April 2008 - 02:22 PM

It is an issue of 7z.
I tried and got the following:
7z.gif
7z uses all cpu and memory ressources. but it is working!
The size of ModelRAM.exe is increasing continously.

So maybe after several hours it would be completed.

But when thinking about the stuff again, a complete modelram.exe would not help.
It has to be expanded into a 4 GB RAM disk. And how build a 4GB RAM disk in my 1 GB RAM?

Peter

Thanks Peter,

Is it possible to store files on a CD/DVD seperate from the PE portion? i.e. burn the ISO to a DVD/RW disk and then add the backup files later? Will it still boot? I will pick up some DVD/RW disks for testing today.

#24 pscEx

pscEx

    Platinum Member

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

Posted 01 April 2008 - 02:50 PM

Thanks Peter,

Is it possible to store files on a CD/DVD seperate from the PE portion? i.e. burn the ISO to a DVD/RW disk and then add the backup files later? Will it still boot? I will pick up some DVD/RW disks for testing today.


Try http://nativeex.boot...hortcuts.Script

Description here

Peter

#25 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 01 April 2008 - 06:27 PM

Try http://nativeex.boot...hortcuts.Script

Description here

Peter

Peter, I will look into your project to see if it deals with this issue...

I have successfully added a sub-folder containing backup images to a bootable dvd+rw using an iso editor (easy); I can boot the disk even using bootsdi loaded into ram (backup folder with files not loaded into ram). I can open Acronis and browse to the image BUT the program doesn't recognize the file :thumbsup: I don't understand this behavior; if I browse to the exact same file on my hard drive, no problem! Can anyone explain what is going on here?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users