|
|
#1 |
|
Junior Member
Join Date: Apr 2004
Posts: 2
|
Get IP address for IIS Service
I am using NSIS to install a perl program on an IIS server.
However, although on my machine, I use the standard http://127.0.0.1/ to access the website on my IIS server, a friend who wants to use the program has a different setting as he is running a separate server on his intranet. I cannot find a means of finding this IP address in the registry which is a pain. So, I guess I need to prompt the user to enter the IP address on installing the program (unless anyone has a better idea). Does anyone know of a reliable code to enter an IP address? I have searched the archive, but to no avail. Also, I have created a simple .ini file to display the prompt, but cannot get it to display: ( in main section I have included) !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "E:\license.txt" ; Need to read IP address Page custom SetIP "ValidateIP" "Set your IP Address" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH (and then later on included) . . . . . Function SetIP ;Display the InstallOptions dialog InstallOptions::dialog "$PLUGINSDIR\IP.ini" !insertmacro MUI_HEADER_TEXT "Select IP Address" "Enter the IP Address of your server\n(Default 127.0.0.1)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "$PLUGINSDIR\IP.ini" !insertmacro MUI_INSTALLOPTIONS_READ $varCustomerIP "$PLUGINSDIR\IP.ini" "Field 1" "State" ; Temporary fix StrCpy $varCustomerIP "127.0.0.1" FunctionEnd |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2004
Location: Strasbourg, Europe
Posts: 117
|
Hi rwap
![]() To check your IP adress you could use this code written by 'Smile2Me': http://nsis.sourceforge.net/archive/....php?pageid=60 About the dialog that does not display: Have you extracted your INI file into the plugins directory ? Otherwise add this bit of code in the '.onInit' function, after the instruction 'InitPluginsdir'. PHP Code:
evilO/Olive PS: welcome to the forums ! |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2004
Posts: 2
|
Thanks for the pointers.
Alas, I had already tried the script by Smile2Me which you suggested, and once I converted it to run properly (ie. did not use test data), it does not return anything on my machine !! I have however now got my page displaying asking the user to enter the IP address of their server. I just now need to come up with some code to validate the string returned ! |
|
|
|
|
|
#4 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Use the NSIS string functions.
|
|
|
|
|
|
#5 | ||
|
Senior Member
Join Date: Jan 2004
Location: Strasbourg, Europe
Posts: 117
|
Quote:
Quote:
Which function did you try to use? I do use a modified version of this code, it's working fine!evilO/Olive |
||
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|