Adding to file 'hosts' from TD

T

Tony

Hi. I need to add an entry to the "hosts" file of my XPe image. I
_could_ just modify "hosts" in the resulting pre-FBA image each time I
do a build, but I would prefer to do this through TD if possible. Any
ideas on how I could do this?

Thanks.
- Tony
 
K

KM

Tony,

Check out "Windows Sockets" component. You will find the "hosts" file in the components' Files section.
You can also create your own components to hold the "hosts" file and change the component any time (+ updating it in your
Configuration).
 
T

Tony

Thanks. I saw the "Hosts" file in the Windows Sockets component, but
I can't figure out how to _edit_ (or add to) that file. The "File
Resource Properties" box does not let me do it. Is there a way to do
this?

If I create another component that includes a different "Hosts" file,
how can I ensure that the one I created will replace the one from the
Windows Sockets component?

And while I'm on this topic, I have had trouble adding file resources
to a component. When I want to place a file in a specific directory
in the XPe image, do I _have_ to put that file in that same directory
on my machine? When I click on "Browse" to select a file, the
"Effective Path" changes to the directory the file came from on my PC
which is not the effective path that I want. When I change
"Destination" to the location I want the file to go, I get an error
saying that the file could not be found on my PC (because I have
effectively changed the directory). Am I doing something wrong?

Thanks for the help.
- Tony
 
S

Slobodan Brcin \(eMVP\)

Tony,
Thanks. I saw the "Hosts" file in the Windows Sockets component, but
I can't figure out how to _edit_ (or add to) that file. The "File
Resource Properties" box does not let me do it. Is there a way to do
this?

No there is no way that you can do this from TD or CD. You must create your
custom host file in your repository that will be used instead.
If I create another component that includes a different "Hosts" file,
how can I ensure that the one I created will replace the one from the
Windows Sockets component?

Create your component in CD that will copy the files you want from your
repositories.
You have always a choice to use build order options for each file, component
build order dependencies, etc.
And while I'm on this topic, I have had trouble adding file resources
to a component. When I want to place a file in a specific directory
in the XPe image, do I _have_ to put that file in that same directory
on my machine? When I click on "Browse" to select a file, the
"Effective Path" changes to the directory the file came from on my PC
which is not the effective path that I want. When I change
"Destination" to the location I want the file to go, I get an error
saying that the file could not be found on my PC (because I have
effectively changed the directory). Am I doing something wrong?

The best way would be to create custom component.
cerate some folder for your custom components.
Create sub folder for files for some component.
Copy your files to that folder (flat folder structure don't use subfolders
and make sure that all files have unique names)
Open CD.
Add files to it.
change build order.
Create repository.
Set repository.
Select file paths.
.....
....
This is all well documented in help reachable from CD.
Or in this NG:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&group=microsoft.
public.windowsxp.embedded

Watch for the link wrap.

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell
Microsoft!
https://www.windowsembeddedeval.com/community/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
K

KM

Just to add to that:
The best way would be to create custom component.
cerate some folder for your custom components.
Create sub folder for files for some component.
Copy your files to that folder (flat folder structure don't use subfolders
and make sure that all files have unique names)
Open CD.
Add files to it.
change build order.
Create repository.
Set repository.
Select file paths.
....

Better to add "Windows Sockets" component as a dependency to the new component (your component should be built AFTER the "Windows
Sockets").
Also, when you add your new "hosts" file set Overwrite flag ("Advanced" button) to True (default state is False :-( ) to overwrite
the "hosts" from the "Windows Sockets".

You can also archive all this by using TD Extra Files section. Only make sure you set build order there that is higher than the
"Windows Sockets" build order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top