Search code examples
nsis

NSIS : Inserting links in label


Suppose I have following nsDialog label:

By clicking Accept I agree to the Example's License Agreement and Privacy Policy. You may access features that requires use of personal information. For more information, please download Example's Content Policy.

I want to insert the links in this label like below:

By clicking Accept I agree to the Example's License Agreement and Privacy Policy. You may access features that requires use of personal information. For more information, please download Example's Content Policy.*

I am able to create links with NSD_CreateLink but I dont know how to make it as above.


Solution

  • Create several labels with ${NSD_CreateLabel} like this ( '|' is separator ):

                  Label1             |    Label2     |Label3| Label4  |  Label5...
    

    By clicking Accept I agree to the Example's | License Agreement | and | Privacy Policy | You may access...

    So your text will be composed from several separate labels placed one by one to create your text.

    Then simply use Linker plug-in (http://nsis.sourceforge.net/Linker_plug-in - few days ago I updated it to support transparent texts) with those labels which should be links:

    Linker::link /NOUNLOAD $Label2Hwnd "http://www.unsigned-softworks.sk/"
    Linker::link /NOUNLOAD $Label4Hwnd "http://www.graphical-installer.com/"