Search code examples
nsis

nsis as a installer of other installs


I'm using NSIS to a installer of other install. After copy all the files needed I run it:

Section "Indusoft" SEC02
  SetOutPath $INSTDIR\DISK1
  ExecWait "$INSTDIR\DISK1\setup.exe"
SectionEnd

Section -Prerequisites
  SetOutPath $INSTDIR\Prerequisites
  MessageBox MB_YESNO "Install FTP Server?" /SD IDYES IDNO endFTPServer
    ExecWait "$INSTDIR\Prerequisites\FileZilla_Server-0_9_41"
    Goto endFTPServer
  endFTPServer:
  MessageBox MB_YESNO "Install MS SQL Server?" /SD IDYES IDNO endMSSQLServer
    ExecWait "$INSTDIR\Prerequisites\SQLEXPRWT_x86_ENU.exe"
    Goto endMSSQLServer
  endMSSQLServer:
SectionEnd

Now I want the My Aplication will run an exe that had been installed in Indusoft Section. My idea is to open a dialog where the user select the file and after create the shortcut to the file selected by the user:

CreateShortCut "$SMPROGRAMS\My application\My application.lnk" "$INSTDIR\AppMainExe.exe"

Is that possible?

Thanks

EDIT: I found to select the file but that way I creating a new page that appears after the finish dialog, how can I make it appear before the finish? Thanks

Var Dialog
Var Text

Page custom nsDialogsPage

Function nsDialogsPage

    nsDialogs::Create 1018
    Pop $Dialog

    nsDialogs::SelectFileDialog
    Pop $Text

    ${NSD_CreateText} 0 13u 100% -13u $Text
    Pop $Text

    nsDialogs::Show

FunctionEnd

Solution

  • Pages are displayed in the same order as the page commands in your source code:

    !insertmacro MUI_PAGE_INSTFILES
    Page custom YourCustomPage
    !insertmacro MUI_PAGE_FINISH