0

I would like to add a text from an online text file link and insert it the following way:

BrandingText "14.05.01"

or

!define MUI_WELCOMEPAGE_TEXT "14.05.01"

Does NSIS offers this possibility?

Lonzak
  • 9,334
  • 5
  • 57
  • 88

1 Answers1

1

Yes this is possible. I use the inetc plugin to access a file from a website:

#get txt file (silently)
inetc::get /NOCANCEL /SILENT "https://valeo.googlecode.com/svn/trunk/versao.txt" "$TEMP\versao.txt" /end
#you may check the return value with: 'Pop $0' and 'StrCmp $0 "OK" 0 Error'
#read file content
FileOpen $4 "$TEMP\versao.txt" r
# read until the end of line and save it to $1
FileRead $4 $1 
#close the file
FileClose $4 
# Now do what you want with $1

UPDATE:

Yes this code goes into a function. But this is no problem, just follow the description here.

Community
  • 1
  • 1
Lonzak
  • 9,334
  • 5
  • 57
  • 88
  • How to use this code if the BrandingText can not be within Section or Function. And the above code can not appear outside Section or Function? – Leonardo Gregianin Apr 28 '14 at 13:38