inhwltz466
Posts: 8
Joined: Sat Oct 22, 2022 6:21 pm

I'm not able to add a line to hosts during installation!

Hello,
I'm not able to add a line to hosts during installation! (C:\Windows\System32\drivers\etc)

Help me please.

I'm using Advanced installer v20
Liviu
Posts: 1042
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: I'm not able to add a line to hosts during installation!

Hello and welcome to our forums,

You can achieve this by using a "Text File Update" with an "Append/Create" operation. The first line you write in the "File Content" section will be appended as a new line of the file content in case the file exists.

You can also have a look on the How do I modify the HOSTS file? forum thread which debates the same question.

If you have any questions just let us know.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
inhwltz466
Posts: 8
Joined: Sat Oct 22, 2022 6:21 pm

Re: I'm not able to add a line to hosts during installation!

I've tried to do that but it didn't work! Could you send me an example for me to run and work?
Liviu
Posts: 1042
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: I'm not able to add a line to hosts during installation!

Hello,

Please find attached a sample project.

After you build and install the package, the hosts file will be successfully modified:
hosts.png
hosts.png (144.66 KiB) Viewed 3143 times

Let us know if you have any questions.

Best regards,
Liviu
Attachments
hosts sample.aip
(21.61 KiB) Downloaded 156 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
inhwltz466
Posts: 8
Joined: Sat Oct 22, 2022 6:21 pm

Re: I'm not able to add a line to hosts during installation!

It worked!
Thank you very much!
But how do I make it work on 32 bit system?
Liviu
Posts: 1042
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: I'm not able to add a line to hosts during installation!

Hello,
It worked!
Thank you very much!
You're always welcome!
But how do I make it work on 32 bit system?
For this you can try to add your Text File Update on the System folder.
system.png
system.png (28.88 KiB) Viewed 2909 times

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”