Sign in to follow this  
Followers 0
goodbyeplanet

help with INI file

4 posts in this topic

I have an ini file like this

section

key=1

The 1 stands for installation done. How do i create a script that will read the ini file and if it finds the number 1 it terminates the installation but if the number 1 is not there it does the installation and then sets number 1 when the installation is done....

thank u for your help

Share this post


Link to post
Share on other sites



Maybe...

If IniRead("MyFile.ini", "Section", "Key", 0) = 1 Then
    MsgBox(0, "Sorry", "The program was already installed    ", 10)
    Exit
Else
    IniWrite("MyFile.ini", "Section", "Key", 1)
    MsgBox(0, "Great", "The program will now be installed    ", 10)
    ; install
EndIf

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

How do i create a script...

SciTE, although any other text editor of your choice could be used.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Maybe...

If IniRead("MyFile.ini", "Section", "Key", 0) = 1 Then
    MsgBox(0, "Sorry", "The program was already installed    ", 10)
    Exit
Else
    IniWrite("MyFile.ini", "Section", "Key", 1)
    MsgBox(0, "Great", "The program will now be installed    ", 10)
    ; install
EndIf

yes that worked like charm thanks for helping me, really appreciate it

8)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0