View forum topic
List of forum topicsSubject: Radiobuttons -> Ini File - Set Value
Hi there,
I'm new to CreateInstall and I have a (probably) rather simple problem:
What I want is
Depending on Radiobutton setting typeA or typeB I want to write "Machine=A" or "Machine=B" into an INI-File.
What I have is
>"Dialog - Settings"
Radiobutton; Varname:machine; Text:typeA
Radiobutton; Varname:machine; Text:typeB
>"Set Variables"
Varname:machine; Value:A; IfCondition:Smachine == "typeA"
Varname:machine; Value:B; IfCondition:Smachine == "typeB"
>"INI File - Set Value"
Filename:User.ini
Section:Application
Key name:Machine; Value:#machine#
But somehow it doesn't work. I must have misunderstood some basic concepts. I'm not finding a working solution with the help of the documentation.
I found it out with a lot more trial&error.
But now the problem is:
It creates a new INI-File with only these values inside.
I want to Modify these 2 lines in my existing INI, not replace it entirely.
You have to specify different variable names for radiobuttons.
The radiobutton variable equals 1 if it is checked and otherwise, it is zero.
For example
>"Dialog - Settings"
Radiobutton; Varname:typea; Text:typeA
Radiobutton; Varname:typeb; Text:typeB
>"Set Variables"
Varname:machine; Value:A; IfCondition: typea
Varname:machine; Value:B; IfCondition: typeb
>"INI File - Set Value"
Filename:User.ini
Section:Application
Key name:Machine; Value:#machine#
>It creates a new INI-File with only these values inside.
It means you specify wrong INI file filename or directory.
You can send your .ci project file to info@createinstall.com.
I did it wrong: I had "INI File - Set Value" before "Dialog - Progress" (Copy Files); It was overwritten after it was set.
Now having it in the right order, i get a different effect:
The specified variables are appended at the end. My file looks like:
==========BOF==========
[Application]
Machine=A
Delta=6
[OtherSection]
TetraKas=5.9981
==========EOF==========
After Installation I get:
==========BOF==========
[Application]
Machine=A
Delta=6
[OtherSection]
TetraKas=5.9981
[Application]
Machine=MyInstallerSetting
===========EOF==========
But i would really need my existing section modified.
Like a normal INI-File API works, it sets or changes the value if found.
It is strange. INI-Set Value overwrites the existing INI-file parameters.
Send your .ci project file and examples of INI-file before and after the installation to info@createinstall.com.
Solved. I didn't see the UTF-8 Checkbox :/
Thanks for your help.
January 16, 2025 Installer CreateInstall 8.11.1 was released.
June 19, 2024 Installer CreateInstall 8.11.0 was released. read more
November 13, 2022 Installer CreateInstall 8.10.1 was released.
May 21, 2022 Installer CreateInstall 8.10.0 was released.
September 25, 2021 Installer CreateInstall 8.9.0 was released.
July 15, 2021 Installer CreateInstall 8.8.1 was released.