- NSIS Discussion
- ini file and nsi file problem
Archive: ini file and nsi file problem
joe1202
4th February 2009 10:39 UTC
ini file and nsi file problem
here i attached my INI file and NSI file.
in korea, it's hard to find an example or sample of NSI script. and i know i'm a quiet slow learner. but i'm working hard.
===== my folder structre: ==========
1280WTF
1680WTF
1680bifWTF
data
etc
Fonts
Interface
Raid
now i have 2 questions.
Q1. how can i choose 1 of 3 WTF folders?
i really don't know how so i tried to copy every folders first. and then if i choose one by clicking radiobutton, the installer should rename it to "WFT" and erage other 2 WFT folders. but it doesn't work.
when i choose 1280WFT, i want it to extract 1280WFT, data, etc, Fonts, Interface and Raid. with check box, it works but i want to make it with radiobutton because i want to show the users resolution image.
Q2. when i use
" File /oname=$PLUGINSDIR\AccountInf.ini "AccountInf.ini"
" File /oname=$PLUGINSDIR\AccountInf1.ini "AccountInf1.ini"
background color of INI file doesn't match.
http://wow.somegate.com/upload/joe12...43714_back.jpg
i want this color looks natural
please, give me some hints, i'm ready to study and learn!
Comperio
4th February 2009 15:39 UTC
For question 1, I'd just use the custom page to set your own variables. Then, deal with the folders during the actual install (from within the sections). You may have to come up with your own logic in the page's leave function.
For question #2 (the screen background), have a look at the UMUI thread here: http://forums.winamp.com/showthread....installoptions
There's a post that reads like this:
If you want your page will be automatically skinned you have to use the INSTALLOPTIONS_DISPLAY or INSTALLOPTIONS_DISPLAY_RETURN macros.
The init dialog doesn't do this because if you set your own color into your pre function thes will be erase by the INSTALLOPTIONS_SHOW, INSTALLOPTIONS_SHOW_RETURN macros.
You should probably also read the UMUI documentation to see if there are any other special needs. (Personally, I've never used UMUI, so I don't have a whole lot of hands-on experience.)
joe1202
4th February 2009 21:53 UTC
thank you Comperio. Q2 has solved.
now i'm trying to write a page funtion for chooseing forder which to install
your advises are always always helpful to begginers like me!
joe1202
5th February 2009 03:26 UTC
can someone give me a hint about usage of radiobutton?
i don't have any knowledge about programming and
i tried write my script like ============================
Function MonitorLeave
; At this point the user has either pressed Next or one of our custom buttons
; We find out which by reading from the INI file
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Settings" "State"
${Unless} $0 = 0
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 4" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 7" "HWND"
ShowWindow $1 $0
StrCmp $0 4 normal1280
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 5" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 8" "HWND"
StrCmp $0 5 widenormal
ShowWindow $1 $0
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 6" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 9" "HWND"
StrCmp $0 6 widebig
ShowWindow $1 $0
abort
normal1280:
!insertmacro MUI_INSTALLOPTIONS_READ $INI_RESOLUTION "$PLUGINSDIR\AccountInf.ini" "Field 4" "State"
SendMessage $INI_RESOLUTION ${WM_SETTEXT} 0 "STR:"
widenormal:
!insertmacro MUI_INSTALLOPTIONS_READ $INI_RESOLUTION "$PLUGINSDIR\AccountInf.ini" "Field 5" "State"
SendMessage $INI_RESOLUTION ${WM_SETTEXT} 0 "STR:"
widebig:
!insertmacro MUI_INSTALLOPTIONS_READ $INI_RESOLUTION "$PLUGINSDIR\AccountInf.ini" "Field 6" "State"
SendMessage $INI_RESOLUTION ${WM_SETTEXT} 0 "STR:"
StrCmp $INI_RESOLUTION 4 copy1280
StrCmp $INI_RESOLUTION 5 copy1680
StrCmp $INI_RESOLUTION 6 copy1680big
copy1280:
File /a /r "F:\boddalheeUI\1280WTF"
Rename "$INSTDIR\1280WTF" "$INSTDIR\WFT"
Goto end
copy1680:
File /a /r "F:\boddalheeUI\1680WTF"
Rename "$INSTDIR\1680WTF" "$INSTDIR\WFT"
Goto end
copy1680big:
File /a /r "F:\boddalheeUI\1680bigWTF"
Rename "$INSTDIR\1680bigWTF" "$INSTDIR\WFT"
end:
${EndUnless}
FunctionEnd
=========================================================
but it doesn't work at all.
i want it like this way. when user click the first radiobutton(1280:Field 4), run 1280copy.
i think i still don't understand how to get a value of user input in INI.
lots of $ code make me crazy @.@
Comperio
5th February 2009 05:40 UTC
i don't have any knowledge about programming and ...
...
i think i still don't understand how to get a value of user input in INI.
My suggestion at this point would be for you to start by learning basic scripts before you start messing with advanced stuff like custom pages and interface skins like UMUI.
There's a ton of information and documentation available to you in the NSIS installation directory and on the Wiki. (There's a whole section dedicated to
tutorials. You can also find information by searching this forum.
For your current problem, you probably should do the file copy stuff from inside a section. (See
this forum thread.)
joe1202
5th February 2009 06:27 UTC
i alreay read all the examples and docs in my NSIS folder and i have read that thread many times. i saw may $1 $2 $3 $4 $R0 things like these.
what matter is, i still don't know where to find information about using $ stuffs. but i'm keep working on it. i hope i will find a way soon :)
Thanks always Comperio!
joe1202
5th February 2009 16:00 UTC
i checked this and this page
and i wrote like ===============================
Function MonitorLeave
; At this point the user has either pressed Next or one of our custom buttons
; We find out which by reading from the INI file
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Settings" "State"
${Unless} $0 = 0
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 4" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 7" "HWND"
ShowWindow $1 $0
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 5" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 8" "HWND"
ShowWindow $1 $0
ReadINIStr $0 "$PLUGINSDIR\AccountInf.ini" "Field 6" "State"
ReadINIStr $1 "$PLUGINSDIR\AccountInf.ini" "Field 9" "HWND"
ShowWindow $1 $0
abort
end:
${EndUnless}
FunctionEnd
and in the section ==================================
ReadINIStr $R0 "$INSTDIR\Account.ini" "Field 4" "State"
StrCmp $R0 1 0 +4
File /a /r "F:\boddalheeUI\1280WTF"
Rename "$INSTDIR\1280WTF" "$INSTDIR\WTF"
Goto done
ReadINIStr $R0 "$INSTDIR\Account.ini" "Field 5" "State"
StrCmp $R0 1 0 +4
File /a /r "F:\boddalheeUI\1680WTF"
Rename "$INSTDIR\1680WTF" "$INSTDIR\WTF"
Goto done
ReadINIStr $R0 "A$INSTDIR\ccount.ini" "Field 6" "State"
StrCmp $R0 1 0 done
File /a /r "F:\boddalheeUI\1680bigWTF"
Rename "$INSTDIR\1680bigWTF" "$INSTDIR\WTF"
done:
=====================================
but when i test its install file, only one works
other two options don't work.
all the other parts work well. but still don't get wht the other 2 options don't work. can someone explane for me?
joe1202
6th February 2009 03:43 UTC
i think i found a way and everything works prett well.
thanks to everybody replied!!