jlevy
30th January 2008 23:38 UTC
Using Answer files for silent installs
I was looking to do a silent install for my installer but i have alot of option. i came across the recommendation in the help file to use an answer file for complex installs, but after that i found nothing talking about this.
Has anyone used these or would it be better to just use complex command line flags for silent installs?
If i should just change up things to make it more silent friendly any good refs would be welcomed.
Thanks guys!
valentz142
31st January 2008 03:16 UTC
You could use ini file for your answer files
The idea is something like this:
(example to set $INSTDIR from ini file)
; --------------------- Code Begin
; Find MyAnswerFile.ini in same location as installer file
; if could not find goto NoINIFile
IfFileExists `$EXEDIR\MyAnswerFile.ini` 0 NoINIFile
; Read RootPath in Section Install from MyAnswerFile.ini
ReadINIStr $0 `$EXEDIR\MyAnswerFile.ini` Install RootPath
; set installation directory to path in MyAnswerFile.ini
StrCpy $INSTDIR $0
Goto ContinueToNextCode
NoINIFile:
; Set your default value here since no answer file is found
StrCpy $INSTDIR `$PROGRAMFILES\My Program`
ContinueToNextCode:
; Your next code
; --------------------- Code End
MyAnswerFile.ini
----------------
[Install]
RootPath=D:\My Program
Hopefully could help
jlevy
31st January 2008 16:55 UTC
Thank you valentz142 that makes all that make more sense.
Now if I have a user that needs to use a full command line to use for deploying over a network via GPO. Is there a good way to make an install more command line friendly?
Sorry for the noob question.
onad
6th February 2008 15:04 UTC
Yes, as always see the wiki ;)
http://nsis.sourceforge.net/Category...Line_Functions