카테고리 없음

nsis에서 rest api호출하기

쌀덕이 2017. 1. 6. 17:51

Nsis로 윈도우즈 앱을 배포하고있는데,

설치후에 API서버와 통신을 해달라는 요청이들어왔다.


방법은 간단하게 

NSISdl로 파일을 다운로드한 후 파일을 읽어들이면된다.


  !define DownloadPath "$TEMP\result.txt" ; set download path


  NSISdl::download_quiet /NOIEPROXY "api address" ${DownloadPath}  ; download api result

  FileOpen $4 "${DownloadPath}" r

  FileSeek $4 0

  FileRead $4 $1 ; read first line

  FileClose $4

  Delete ${DownloadPath}


 - 참고 페이지

http://nsis.sourceforge.net/Reading_and_Writing_in_files

http://stackoverflow.com/questions/15576075/trying-to-communicate-with-a-rest-service-with-nsis