|
|
|
|
#1 |
|
Junior Member
Join Date: Jan 2015
Posts: 4
|
Hello Team,
I am overwhelmed to be part of this forum. I am a newbie started using NSIS since Nov 2014 extensively to create a client installer for our product. Currently i am working on converting the same installer to silent mode. I have created a installer which accepts Login and Password as parameter. 1. I check using inetc: ost method and pass username and password to for existense of those accounts in my db2. I authenticate using inetc::get method 3. I pull a certificate based on the user details using inetc::get method 4. Install the content I use Setsilent method on Function .OnInit to test for now. Function .onInit MessageBox MB_YESNO|MB_ICONQUESTION "Would you like the installer to be silent from now on?" \ /SD IDYES IDNO no IDYES yes yes: SetSilent silent Goto Installer no: SetSilent normal Installer: Following observations i made upon trying out silent installation. as soon i select silent installation all inetc methods are not executing but content is dropped to expected folder. No authentication , no certficate is getting downloaded. Can you help me with this problem. Thank you in advance. Awaiting for your reply |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
There are no pages in silent mode. Therefore if you have any code in page callbacks, they will never execute in silent mode.
Stu |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2015
Posts: 4
|
Can you suggest any other way where i can perform my operation and compatible to silent too.
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
You can use IfSilent or ${If} ${Silent} to perform required operations in your sections...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2015
Posts: 4
|
Hello team,
Thank you for your time and hint. This is a code snippet which i want to make silent Can you give me an example using the same code snippet. This would be of great help to us. Function Authenticate #Call to REST API for user authentication nsJSON::Set /file "c:\temp\<some file>" ShowWindow $WAITMSG ${SW_SHOW} ${NSD_SetText} $WAITMSG "User authentication in progress...." AnimGif: lay /NOUNLOAD /HALIGN=83 /VALIGN=73 $PLUGINSDIR\a.gifinetc: ost "grant_type=password&username=$UserNameText&password=$UserPwdText" /SILENT "<URL>" "c:\temp\<some file>" /ENDNsisCrypt::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} $0 == "yes" nsJSON::Get "access_token" /END Pop $TOKEN #MessageBox MB_OK $TOKEN StrCpy $isValidUser "true" #Call to REST API for getting the institution details ${NSD_SetText} $WAITMSG "Getting Institution details...." 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>" ShowWindow $WAITMSG ${SW_HIDE} AnimGif::stop FunctionEnd |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jan 2015
Posts: 4
|
Hello team,
I request experts , Moderator, Senior Member to help me with this. |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Perhaps something like this (untested):
PHP Code:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
![]() |
|
|||||||
| Tags |
| silent installer |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|