1

Is anyway there I can able to get IP address of the system where I am installing my setup application using INNOSETUP?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
reapen
  • 705
  • 4
  • 13
  • 26
  • You can have more than one IP address assigned... – TLama May 29 '13 at 07:17
  • Why do you need the IP address during the installation? – Bernard May 29 '13 at 07:49
  • You could take a look at [this solution](http://stackoverflow.com/questions/6166900/how-to-get-the-local-ip-address-using-inno-setup) – RobeN May 29 '13 at 07:57
  • @RobeN I tried that solution which you given but when tries to execute it's showing error saying unknow tag WordBool . – reapen May 29 '13 at 10:15
  • @reapen - that means you are probably modified the code (or maybe you use ANSI version of Inno Setup?). When I use 1:1 I get MsgBox non the Initialize with my IPs listed. – RobeN May 29 '13 at 10:20
  • @RobeN I not modified the code.i am using Inno Setup Compiler version 5.5.3.is this version you also using? is so can you give an example for that? – reapen May 29 '13 at 13:13
  • @reapen - I'm also usin 5.5.3. However I use Unicode version - what may be important. – RobeN May 29 '13 at 13:16
  • @RobeN: actually i want is to get IP address of users who will be installing our application through innosetup.as there is one requirement for saving user's ip in database.So it's will be great help to know while executing the application we can able to capture the IP address of user. – reapen May 29 '13 at 16:24
  • 3
    If you want to capture one or more of the IPs of each user who runs your application, then that sounds like something you'd do in your application, not the installer. After all, a given computer may have several IPs and they may change over time. (TBH I don't see what possible use this sort of thing would be, given that.) – Miral May 29 '13 at 20:31
  • Anyways, that script captures IP addresses of the computer which runs the installer/setup. So in fact you can do with received data anything you need. – RobeN Jun 04 '13 at 08:48

1 Answers1

0

you can use this function:

Exec(ExpandConstant('{cmd}'), '/C ipconfig | findstr "IPv4"', '', 0,ewWaitUntilTerminated, ResultCode);

you will get IP address of the system

Windows:

C:\Users\LEo>ipconfig | findstr "IPv4"
IPv4 addr . . . . . . . . . . . . : 192.168.1.101
IPv4 addr . . . . . . . . . . . . : 192.168.0.82
LEo
  • 442
  • 5
  • 21
  • Sorry, this function can only get the return value(ResultCode).you can not get ip :) – LEo Jul 23 '14 at 02:42
  • Avoid using command line tools as much as you can. Always prefer native Windows API solutions. In this question is the term IP of system pretty vague and as you can see in your listing, on your system you got two different IPs. – TLama Jul 23 '14 at 07:33
  • thks for your suggestion, so I can not get the IP, .:( I will try it. – LEo Jul 23 '14 at 13:09