NSIS Installer - Displaying different licences

99封情书 提交于 2019-12-04 05:35:59

There are two ways to skin this cat:

  • Use 2 license pages and skip one of them
  • Load the license file manually at run-time

Two pages:

!define MUI_PAGE_CUSTOMFUNCTION_PRE skip1
!InsertMacro MUI_PAGE_LICENSE Content\Licence.rtf
!define MUI_PAGE_CUSTOMFUNCTION_PRE skip2
!InsertMacro MUI_PAGE_LICENSE Content\Licence2.rtf
#You need two functions skip1 and skip2, they should call `abort` to skip based on some state you determine at run-time

Manual load:

There is a plugin that does this for you (Not sure if it supports RTF)

I wrote some code that does this using the system plugin, you can find that on the nsis forum. To use that code, you would include your license files with normal File commands and extract the one you want to $pluginsdir and load it in the license page's show callback function.

Erundil

There is an easier way. I use this code:

!insertmacro MUI_PAGE_LICENSE $(MUILicense)

Also, you have to put in your code lines like this:

LicenseLangString MUILicense ${LANG_POLISH} "SomeDirectory\licencja_pl.txt"
LicenseLangString MUILicense ${LANG_ENGLISH} "SomeDirectory\license_en.txt"

They don't have to appear before inserting license macro. In my code I defined them just below and it works fine.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!