HTTP POST request in Inno Setup Script -


I want to submit some information gathered from the user during the Inno setup installation on our server via post.

The obvious solution is to include an .exe file that will remove the setup in a temporary location and launch it with parameters. However, I am thinking - is there any easier / better way?

Based on the advice jsobo using the WinHttp library, I very Come up with a simple code that runs, say, you want to send a serial number for verification before the actual installation starts. In the code section, put:

  process karstepanked (curlestop: tsetupupstep); Var Win HTTP: Variants; If CurStep = ssInstall starts, then start AutoCheckRadioButton.Checked = True then WinHttpReq: ​​= CreateOleObject ('WinHttp.WinHttpRequest.5.1'); WinHttpReq.Open ('Post', '  

The method takes HTTP method as a logic of the URL and async has to request and it seems that we have to set SetRequestHeader to set Content type titled application / x-www-form-urlencoded .

will keep the WinHttpReq.Status response code so that it can detect if the server has returned successfully:

  If WinHttpReq.Status & lt; & Gt; 200 then MSBBC ('Error', MBRR, MB_OK) starts; End MSBbox starts ('success', MBInConption, MB_OK); End;   

WinHttpRequest lists all the methods and properties of the object.

In addition, to avoid run-time errors (host-accessible-without-accessable) around code, try to leave / except code to enter a code Good idea.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -