rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

How could I read an "external" .INI file?

The situation is...

1. Network (server) install to a central or shared drive.
2. Client install from shared drive to various other PC's in the organization.

I'd like to stash a database connection string in a new INI file during the Server installation part - that's easy.

But then I need to be able to read this info back out of the INI file during the client install - and the client installer doesn't know about this INI file. I can reference a "new INI file" by the same name in AI, but the one I'll really want is going to live in the source folder, not inside the MSI.

Maybe a file copy operation would do it?

Suggestions?

Thanks,
R
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How could I read an "external" .INI file?

Hi,

If you need to read the INI file during install you can try using a custom action (Windows Installer doesn't offer direct support for this). You can find some sample VBScript code here.
If you just want to copy the file you can try using a file copy operation. You can find more details in the Install an user specific file how-to.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”