Archive: MULTIUSER_PAGE_INSTALLMODE page not showing


MULTIUSER_PAGE_INSTALLMODE page not showing
I'm doing a "!include MultiUser.nsh" and "!include "MUI2.nsh", the "RequestExecutionLevel admin" then later doing a "!insertmacro MULTIUSER_PAGE_INSTALLMODE".

For some systems it shows the screen for selecting between “Install for anyone using this compter” and “Install just for me”, but for other systems NSIS skips this screen.

These are identical computers which are set up in almost identical ways, with all users having administrator privileges. The first part of the file follows:

1 !define SRCDIR .
2 !define COMPANY "Company"
3 !define DVRNAME "Diver"
4
5 !define VERSION "$%VERSION_NO%-$%VERSION_PATCH%"
6 !define MULTIUSER_EXECUTIONLEVEL highest
7 !define MULTIUSER_MUI
8 !define MULTIUSER_INSTALLMODE_COMMANDLINE
9 !include MultiUser.nsh
10
11
12 Var /GLOBAL DRIVERFILENAME
13 Var /GLOBAL SETUPDRIVERFILENAME
14
15 # Function that attempts to install an ODBC driver, and gives a retry/cancel
16 # message box if this fails.
17 Function installDriver
18 ClearErrors
19 install:
20 nsExec::ExecToStack '"$INSTDIR\wxodbcinst.exe" -d "${DVRNAME}" -o "$DRIVERFILENAME" -s "$SETUPDRIVERFILENAME" -i "$INSTDIR"'
21 Pop $0 # return value
22 Pop $1 # message
23 StrCmp $0 "error" odbcinstexecfail
24 IntCmp $0 0 installdriverend
25 installdriverfail:
26 MessageBox MB_RETRYCANCEL "$1$\r$\n$\r$\nFailed to update ODBC drivers. Have you another ODBC client running? If so, close that application and choose Retry. Otherwise, choose Cancel to abort." IDRETRY install IDCANCEL installdriverabort
27
28 goto installdriverend
29
30 odbcinstexecfail:
31 MessageBox MB_OK "Failed to execute wxodbcinst.exe."
32 Abort
33
34 installdriverabort:
35 MessageBox MB_OK "Installation not successful."
36 Abort
37
38 installdriverend:
39 FunctionEnd
40
41 Function .onInit
42 !insertmacro MULTIUSER_INIT
43 FunctionEnd
44
45 Function un.onInit
46 !insertmacro MULTIUSER_UNINIT
47 FunctionEnd
48
49
50 !if $%PLATFORM% == Win64
51 !define OLDSHORTDESC "64-bit Client Tools"
52 !define SHORTDESC "64-bit Client Tools"
53 !define PACKAGE wx2clients64
54 !else
55 !define OLDSHORTDESC "32-bit Client Tools"
56 !define SHORTDESC "32-bit Client Tools"
57 !define PACKAGE wx2clients32
58 !endif
59
60 Name "${SHORTDESC}"
61 !if $%PLATFORM% == Win64
62 InstallDir "$PROGRAMFILES64\${COMPANY}\${PACKAGE}"
63 !else
64 InstallDir "$PROGRAMFILES\${COMPANY}\${PACKAGE}"
65 !endif
66
67
68 InstallDirRegKey HKCU "Software\${PACKAGE}" ""
69
70>outfile "${SRCDIR}/setup.exe"
71
72 RequestExecutionLevel admin
73
74 !include "MUI2.nsh"
75
76
77 !define MUI_ICON "${SRCDIR}/icon.ico"
78 !define MUI_UNICON "${SRCDIR}/icon.ico"
79
80 !define MUI_HEADERIMAGE
81 !define MUI_HEADERIMAGE_LEFT
82 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
83 !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}/Contrib/Graphics/Wizard/orange.bmp"
84 !define MUI_ABORTWARNING
85
86
87 !define MUI_WELCOMEPAGE_TEXT "..."
88
89 !insertmacro MUI_PAGE_WELCOME
90 !insertmacro MUI_PAGE_LICENSE "${SRCDIR}/WX2-EULA.txt"
91 !insertmacro MUI_PAGE_COMPONENTS
92 !insertmacro MULTIUSER_PAGE_INSTALLMODE
93 !insertmacro MUI_PAGE_DIRECTORY
94 !insertmacro MUI_PAGE_INSTFILES
95 !insertmacro MUI_PAGE_FINISH
96
97 !insertmacro MUI_UNPAGE_CONFIRM
98 !insertmacro MUI_UNPAGE_INSTFILES
99
100
101 !insertmacro MUI_LANGUAGE "English"
102
103 ...


!define MULTIUSER_EXECUTIONLEVEL highest sets RequestExecutionLevel so why do you set RequestExecutionLevel admin?


Thanks for the prompt response. I have commented out that line, but there is no change.

I forgot to mention we are running Windows 7 Enterprise N, service pack 1, 64 bit.


!define MULTIUSER_EXECUTIONLEVEL highest does not make much sense here, you always want admin rights to install this driver, or can a unelevated user pass the installDriver test if the driver is already installed?

I would suggest adding some messageboxes to the multiuser code, it does try to abort the page in a couple of places...