Old 27th January 2015, 07:17   #1
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Perhaps something like this (untested):
PHP Code:
Function Authenticate
#Call to REST API for user authentication
nsJSON::Set /file "c:\temp\<some file>"
IfSilent skipGuiStart
  ShowWindow $WAITMSG 
${SW_SHOW}
  ${
NSD_SetText$WAITMSG "User authentication in progress...."
  
AnimGif:lay /NOUNLOAD /HALIGN=83 /VALIGN=73 $PLUGINSDIR\a.gif
skipGuiStart
:
inetc:ost "grant_type=password&username=$UserNameText&password=$UserPwdText/SILENT "<URL>" "c:\temp\<some file>" /END
NsisCrypt
::Base64Encode $UserNameText
Pop 
$1
#MessageBox MB_OK $1
nsJSON::Set /file "c:\temp\<some file>" /END
nsJSON
::Get /exists "access_token" /END
Pop 
$0
${If} $== "yes"
nsJSON::Get "access_token" /END
Pop $TOKEN
#MessageBox MB_OK $TOKEN
StrCpy $isValidUser "true"
#Call to REST API for getting the institution details
IfSilent skipGuiSetText
  
${NSD_SetText$WAITMSG "Getting Institution details...."
skipGuiSetText:
inetc::get /SILENT "<URL>" "c:\temp\<some file>" /END

nsJSON
::Set /file "c:\temp\<some file>" /END
nsJSON
::Get /count /END
Pop $INSTITUTIONCOUNT
${Else}
StrCpy $isValidUser "false"
${EndIf}
#delete "c:\temp\<some file>"
IfSilent skipGuiEnd
  ShowWindow $WAITMSG 
${SW_HIDE}
  
AnimGif::stop
skipGuiEnd
:
FunctionEnd

First section
Section 
-SilentAuth
  IfSilent 0 
+2
    Call Authenticate
SectionEnd

Other sections follow 

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
silent installer

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump