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

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

Sat Oct 22, 2022 6:29 pm

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: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

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

Mon Oct 24, 2022 9:29 am

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: 6
Joined: Sat Oct 22, 2022 6:21 pm

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

Mon Oct 24, 2022 11:04 pm

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: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

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

Tue Oct 25, 2022 10:21 am

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.66KiB)Viewed 3079 times

Let us know if you have any questions.

Best regards,
Liviu
Attachments
hosts sample.aip
(21.61KiB)Downloaded 155 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

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

Thu Nov 03, 2022 11:13 pm

It worked!
Thank you very much!
But how do I make it work on 32 bit system?

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

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

Fri Nov 04, 2022 3:21 pm

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.88KiB)Viewed 2845 times

Hope this helps!

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

Return to “Building Installers”