Archive: Include resources in installer


Include resources in installer
Hy.
is possible to include icons ,file .ini and file license.txt in installer?
How?
thanks


Those are already included in the installer itself as resources when you use the commands available. If you want to extract extra resources for your program, use the File command. If you want to insert extra resources into the installer that can't be inserted using the available commands, use Resource Hacker with !packhdr. For an example usage, see removing icons.


and how i access this resources in the script?
for examle i have this code:
Function LeaveCHK
ReadIniStr '$bAcad' '${NSISDIR}\SceltaAcadPsw.ini' 'Field 1' 'State' ;leggo il checkbox installa cmp acad
ReadIniStr '$bPsw' '${NSISDIR}\SceltaAcadPsw.ini' 'Field 2' 'State' ;leggo il checkbox installa file di password
FunctionEnd

were
SceltaAcadPsw.ini is a custom page
how i change
'${NSISDIR}\SceltaAcadPsw.ini'

i try
'SceltaAcadPsw.ini'

but dont work.
thanks


What you are looking for is not called resource. You have to extract the INI file somewhere like $PLUGINSDIR. Then you have to tell ReadINIStr the file is in $PLUGINSDIR, by passing $PLUGINSDIR\SCeltaAcadPsw.ini. See Examples\InstallOptions for usage examples.

However, it'd all be much simpler if you use the macros in InstallOptions.nsh. See Examples\Modern UI\InstallOptions.nsi.


sorry, but i not understand(i see the documentation of InstallOptions )but there isn't a method fo include the .ini file in the setup.exe(setup.exe is the ouput file)?
I must distribuite all' the .ini files whith the installer?
thanks.


File includes files, including INI files in the installer and extracts them to the path set by SetOutPath. That's shown in Examples\example1.nsi.

InstallOptions.nsh is not the readme file. It's a header file with useful macros. You can see how it's used in Examples\Modern UI\InstallOptions.nsi.