Skip to content
⌘ NSIS Forum Archive

Custom page not shown with LZMA

7 posts

fabiochelly#

Custom page not shown with LZMA

I have a custom page that I want to display with InstallOptions just after the MUI_PAGE_DIRECTORY page.

When I compress my setup with ZLIB, everything works fine.
But when I use LZMA /SOLID, the page is not displayed (in fact the MUI_PAGE_DIRECTORY page is shown twice).

I suppose it is because the ini file is not extracted at this time of the setup.

Is there a way to correct this problem?
fabiochelly#
In fact my custom page is shown after 10 seconds !
But before that the InstDir page is shown a second time (the buttons next and cancel change).

Here is my code:

SetCompressor /SOLID lzma
!include "MUI.nsh"
!include "logiclib.nsh"
!include "TextFunc.nsh"
!include "WordFunc.nsh"
!define PRODUCT_NAME "Etebac Engine"
!define PRODUCT_VERSION "2.0"
!define MUI_COMPONENTSPAGE_NODESC
Name "${PRODUCT_NAME}"
BrandingText "Copyright © 2005-2006 Test and Go"
OutFile "EtebacEngineSetup.exe"
InstallDir "c:\TGJSERVER\"
ReserveFile "ip.ini"
!insertmacro MUI_PAGE_DIRECTORY
Page custom OtherParams
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "French"
Function OtherParams
  !insertmacro MUI_HEADER_TEXT "Personnalisation des fichiers" "Saisissez le port COM du modem"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ip.ini"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ip.ini"
  !insertmacro MUI_INSTALLOPTIONS_READ $PORT_COM "ip.ini" "Field 2" "State" ;Port COM du modem
  !insertmacro MUI_HEADER_TEXT "Personnalisation des fichiers" "Remplacement des paramètres"
FunctionEnd 
kichik#
Is that a complete example? The extraction of ip.ini shouldn't take long unless you have more files in there.
fabiochelly#
Yes of course, it's just the important part of my setup.
In fact, I have more than 30 MB of files in my setup.
kichik#
Then you need to at least include the entire script. You've removed crucial parts of the example.

Without seeing the entire script, I can only guess you have File commands before the ReserveFile command in the script. Move ReserveFile above all File commands and use the MUI_RESERVEFILE_INSTALLOPTIONS macro as well. It would also probably be a good idea to extract the INI file only once in .onInit.