|
|
#1 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Hi,
I've been trying NSIS for a couple of days now. I'm creating a serial validation page with 4 fields 5 chars each. I've read the forums, the read-me's for InstallOptions and System, and some examples in the WiKi, and still cant put this to work! I'd thank any help at this. Here are my two functions, along with the initialization code. PHP Code:
Thanks in advance, smoura |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
The thing is that I'm not being able to get the values typed in the wndSerial.ini page back to the variables... :P
|
|
|
|
|
|
#3 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
From a quick look on your script:
you use defines to get values, this is not correct. You must use variables to get the values from INI fields. e.g. change this: !insertmacro MUI_INSTALLOPTIONS_READ ${Key1} "$PLUGINSDIRwndSerial.ini" "Field 2" "State" to this: !insertmacro MUI_INSTALLOPTIONS_READ $R0 "$PLUGINSDIRwndSerial.ini" "Field 2" "State" Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Thanks for the fast reply
![]() I've replaced Has you've said the 4 instructions on my code, though it continues not to extract the data from the fields. Here's the changes I've made to the above source: PHP Code:
|
|
|
|
|
|
#5 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
replace this:
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "$PLUGINSDIRwndSerial.ini" "Field 2" "State" with this: !insertmacro MUI_INSTALLOPTIONS_READ $R1 "$PLUGINSDIR\wndSerial.ini" "Field 2" "State" wndSerial.ini must be the exact name of the IO ini file you have extracted on $PLUGINSDIR Just now I noticed you're making the same mistake in the whole script. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#6 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
There is a missing backslash almost everywhere on your script :-)
When I shaw it first time I focused to to the defines. You should read the script line by line and add the missing backslashes :-) Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
the backslashes are in the code, it seems that when I copy the code from the editor to the post form it removes the backslashes... :P
|
|
|
|
|
|
#8 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
I don't know if the system call to the plugin dll is correct thus working.
Besides that if the INI file extraction is right and your custom page appears normally, this code should read the values from ini fields: Function ValidateCustom ReadIniStr $R1 '$PLUGINSDIR\wndSerial.ini' 'Field 2' 'State' messagebox mb_ok "$R1" ................... Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#9 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
I also noticed some code that is not particularly 'clean':
InstallOptions::dialog "$PLUGINSDIRwndSerial.ini" Pop $R0 Should be: InstallOptions::dialog "$PLUGINSDIRwndSerial.ini" Pop $R0 Pop $R0 This just erases the return value from InstallOptions::dialog (it is pushed onto the stack). [edit]I also just noticed this: Why are you calling a messagebox function with the System plugin? NSIS already has a messagebox function (you probably aready know this).[/edit] "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Thanks all for the replys.
Red Wine: The custom page does indeed appear absolutly normal with the 4 fields to fill. I'm just not being able to get the values back from the fields (the code you've placed is exacly what I'm trying to put to work here). JasonFriday13: Thanks for the note on the Pop, I've put the other Pop instruction on the code still, cant get anything from the form. Has for the message boxes their only for test purposes, to see the value in the first one and then check if I can use the system plugin correctly, hence the real purpose for this issue is serial validation through an auxiliar dll. I'll try to create a clean install to sharpen my skills. All sugestions will be greatly appreciated
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Well I've managed to get the values back from the custom page by using the ReadINIStr instead of the MUI macro, though the problem was that Pop that Jason said, since before using the macro I was using the ReadINIStr to read...
I'll now try to see why the dll doesn't get called, any help on this would be greatly apreciated! ![]() I suppose that this: PHP Code:
|
|
|
|
|
|
#12 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
I guess you want to pop up a messagebox for debug...
Anyway try this: MessageBox MB_OK|MB_ICONINFORMATION "$$R1==$R1" Native message boxes work perfectly, you may want to refer to NSIS documentation for details. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Dammm
![]() ![]() it's working. Thanks all for the replys.The problem with the call to the dll function was that I used the .dll in the System::Call function, rather then using only the DLL name. The final line looks like this: PHP Code:
|
|
|
|
|
|
#14 |
|
Junior Member
Join Date: May 2006
Posts: 17
|
Thanks RedWine! But I was using the Native Message box to try an easier function than my on dll with the System plugin.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|