|
|
#1 |
|
Senior Member
Join Date: Jan 2004
Location: The Netherlands
Posts: 260
|
get info from update.ini
hey. I want this function in my installer. But I dont have a clue how to do it.
What I want is that the installer needs to extract update.ini to $INSTSDIR and that it needs to merge his info with os.ini so ... for example: _______________________________________________________ Update.ini : code: let's say that this is the contents of update.ini _______________________________________________________ Os.ini : code: and let's say this is Os.ini ________________________________________________________ now .. when the installer is done with extracting update.ini then it needs to overwrite the contents of Os.ini with the contents that update.ini has. So after merging then Os.ini will be like this: code: _______________________________________________________ ok .. now I hope someone can help me with this. thanks. With Regards, VegetaSan VegetaSan.... |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2004
Location: The Netherlands
Posts: 260
|
ah sorry never mind .. allready got it .. stupid me >_<
VegetaSan.... |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2004
Location: The Netherlands
Posts: 260
|
ok .lol .. I still got a question. Will this work?
code: VegetaSan.... |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Uhhmmm no.
I think the only way to do this would be to create a custom function to FileRead along with WriteINIStr. There's no way of using ReadINIStr to read through each key in the update.ini, so we will have to read each line using FileRead. I will write a function now... -Stu |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2003
Location: Estonia
Posts: 91
|
don't think so. you have to read each entry one by one into the variable, and then write them to another ini. afther all *.* is used with files. "*" means all, and dot between them is just like in file between name and extension, so *.* means all file names with all extensions
edited: but Afrow UK managed to reply faster(Y) |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Done!
code: Note that you need all three functions! Usage: Push "update.ini" Push "Os.ini" Call ReadINIFileKeys Adding it to archive. -Stu |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2004
Location: The Netherlands
Posts: 260
|
cool.. thanks alot Afrow UK .. you're tha man !!
VegetaSan.... |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Uhm, just noticed an error in the function.
Relace FileClose $R1 with FileClose $R2 Edit: and delete detailprint "$R6 $R4 $R5" (left in from testing) -Stu |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2004
Location: The Netherlands
Posts: 260
|
dont forget to update it in the archive too
VegetaSan.... |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 6,950
|
Oh but of course
![]() -Stu |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Mar 2008
Posts: 129
|
This is a great script but I couldn't get it to blank out an ini setting. I.E. merging in:
[SomeSection] SomeKey= often produces: [SomeSection] SomeKey=SomeKey= It also seems to do strange things with comments sometimes. For example, if a comment ended with ] I think it treats it like a section name. So I added a check for lines that start with ; and skip those. I have added skipping of comments. I think there might still be bugs if the semicolon is preceded by leading whitespace, but there are many apps that don't allow leading spaces in ini files anyhow. I updated the script to work with the newer versions of SplitFirstStrPart, because the version used above does not properly parse "BlankValue=", but the newer version in the wiki does parse it correctly. All that was needed was a Push "=" for SplitFirstStrPart and renaming TrimNewLines to StrTrimNewLines. code: "I object to doing things that computers can do." -Olin Shivers |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|