Modifying win.ini and autoexec.bat

Modifying win.ini and autoexec.bat

Post by Jeff Witz » Wed, 03 Feb 1993 22:53:25



Well, it's finally done.  My first big Windows project.  Thanks to all of
you that help me with the (not so) little problems along the way.  Without
the assistance of this group, I wouldn't have been able to progress from
knowing nothing of programming Windows to completing a solid, already very
successful, rather complicated product in only 5 months. :-)

I do have a new question, though.  I plan to ask the user, during the install
process, if my program should automatically run itself when they power up or
reboot.  This involves making sure that win is called as the last line in
their autoexec.bat and that my program (with its path) is listed on the run=
line, of course.

The question is:  Is there a standard way to do this or should I just do
normal file opens, read, and writes?  The install program I'm currently using
to install the demo version of the program is a slightly modified version of
(what I was told is) Microsoft's install.  Is there a better install, an
install that uses a Borland style dialog, or one that already has the
standard code to self install and self run?

Also, what is the best way to convert the common file dialogs from Microsoft
to Borland style?  I've heard some things about clt3d (sp?) but would like to
know if this is the answer to my problem.  If it is, where can I get it?

Thanks, again


 
 
 

Modifying win.ini and autoexec.bat

Post by John Gra » Fri, 05 Feb 1993 03:26:20


[...stuff deleted...]
Quote:

>I do have a new question, though.  I plan to ask the user, during the install
>process, if my program should automatically run itself when they power up or
>reboot.  This involves making sure that win is called as the last line in
>their autoexec.bat and that my program (with its path) is listed on the run=

        I wouldn't worry about modifying the autoexec.bat for such
        a trivial thing.  It's one thing to put in some set xxx=yyy
        statements, but just to add a 'win' command?  Don't bother.

Quote:>The question is:  Is there a standard way to do this or should I just do
>normal file opens, read, and writes?  The install program I'm currently using
>to install the demo version of the program is a slightly modified version of
>(what I was told is) Microsoft's install.  Is there a better install, an
>install that uses a Borland style dialog, or one that already has the
>standard code to self install and self run?

        As far as modifying the WIN.INI files goes... Use the special
        functions provided in the API:
                GetPrivateProfileString()       for WIN.INI
                GetProfileString()              for xxx.ini (your file)
        There are also Write versions of these functions.

        Also, please resist any temptation to modify the WIN.INI
        file, to include a section for your app.  In fact, don't
        do it!!!  Do not add a [myapp] section.  This only clutters
        the WIN.INI file.  Instead you should create your own MYAPP.INI
        file and maintain that in the Windows directory.

        If I want to remove a product, it should be a simple matter of
        deleting the product's directory and the MYAPP.INI file.
        Right now, I have about 30 different [myapp1], [myapp2]
        sections in my WIN.INI file.  It really upsets me.

Quote:>Also, what is the best way to convert the common file dialogs from Microsoft
>to Borland style?  I've heard some things about clt3d (sp?) but would like to
>know if this is the answer to my problem.  If it is, where can I get it?

        The ctl3d.dll is available at cica.  It comes with documentation.

--

Airborne Geophysics
Geological Survey of Canada, Ottawa

 
 
 

1. Code to Modify the Autoexec.bat (i.e. Adding my path)

Hopefully this is the correct place for this question.  If it is not,
sorry for the instrusion.

I'm working on a simple setup program and I'm looking for some code to
allow me to update a machines autoexec.bat - primarily to add my install
directory to the current path statement(s).  Does anyone have any code
fragments that show how to do this, or know any places that might have
such code.

--------------------------------------------
Take off Late, Go Deep, Go Down Hard...


2. better error detection ?

3. Modify AUTOEXEC.BAT

4. Using Palm Pilot as Remote Control

5. How does one edit the Path in autoexec.bat using a bat?

6. Z80A Assembler algorithm needed!

7. To run config.sys and autoexec.bat at WinME bootup

8. Is it possible? <asp:label> in xsl file

9. Developing setup program with MSsetup, probs with autoexec.bat changes

10. Window: How to autoexec.bat autostart Windows programs

11. Autoexec.bat problem

12. Anything like AUTOEXEC.BAT for DOS virtual machines?

13. find autoexec.bat with setup.exe?