Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit e5bb242

Browse files
committed
installer: Improve user interface
Provide the detailed report of the installation result in the Finish Page. Reports are divided into 4 types: successful installation, system unsupported, system configuration requirements and the corresponding reference link, and VM occupancy. * Add text definitions used in Finish Page * Load report pages dynamically according to the checking result * Adjust some text definitions on other pages Signed-off-by: Wenchao Wang <[email protected]>
1 parent 287fc6f commit e5bb242

File tree

3 files changed

+134
-24
lines changed

3 files changed

+134
-24
lines changed

Installer/HaxmSetup.nsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ Function LoadDriver
216216
${Exit} 0 $code
217217
FunctionEnd
218218

219+
Function onFinished
220+
IntOp $0 $status & ${ENV_FLAGS_SYS_SUPPORTED}
221+
${If} $0 != 0
222+
Call LoadSystemErrorPage
223+
Return
224+
${EndIf}
225+
226+
IntOp $0 $status & ${ENV_FLAGS_GUEST_READY}
227+
${If} $0 != 0
228+
Call LoadGuestErrorPage
229+
Return
230+
${EndIf}
231+
232+
IntOp $0 $status & ${ENV_FLAGS_HOST_READY}
233+
${If} $0 != 0
234+
Call LoadHostErrorPage
235+
Return
236+
${EndIf}
237+
238+
Call LoadSuccessPage
239+
FunctionEnd
240+
219241
Function onAbort
220242
${Exit} 0 0
221243
FunctionEnd

Installer/Resources.nsh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
# Strings
3535
!define PRODUCT_NAME "HAXM"
3636
!define PRODUCT_FULL_NAME "Hardware Accelerated Execution Manager"
37-
!define PRODUCT_VERSION "7.6.5"
37+
!define PRODUCT_DESCRIPTION "Open Source Cross-Platform Hypervisor"
38+
!define PRODUCT_VERSION "7.8.0"
3839
!define PRODUCT_YEAR "2020"
3940
!define PRODUCT_PUBLISHER "Intel Corporation"
4041
!define PRODUCT_BRAND "Intel${U+00AE}"
@@ -76,10 +77,45 @@
7677
!define DLG_REINSTALL "${PRODUCT_NAME} v${PRODUCT_VERSION} has already been \
7778
installed. Are you sure to continue?"
7879
!define DLG_UNINSTALL "Are you sure you want to remove $(^Name)?"
80+
!define DLG_CAPTION_UN "${PRODUCT_BRAND} ${PRODUCT_NAME} Uninstall"
7981
!define LOG_REINSTALL "To reinstall the current version"
8082
!define LOG_UNINSTALL "To uninstall the current version"
8183
!define LOG_UPGRADE "To upgrade version"
8284

85+
!define PG_WELCOME_TEXT "This wizard will guide you through the \
86+
installation of $(^Name) (${PRODUCT_NAME}) ${PRODUCT_VERSION}. \
87+
${PRODUCT_NAME} is a hardware-assisted virtualization engine \
88+
(hypervisor), widely used as an accelerator for Android Emulator and \
89+
QEMU.$\r$\n$\r$\nImportant: ${PRODUCT_NAME} requires an Intel CPU with \
90+
certain hardware features, including ${PRODUCT_BRAND} Virtualization \
91+
Technology (${PRODUCT_BRAND} VT), etc. This installer will check \
92+
whether your computer can run ${PRODUCT_NAME}."
93+
!define PG_LICENSE_BOTTOM "If you accept the terms of the license agreement, \
94+
click Install to continue $(^Name) setup."
95+
!define PG_COMPLETE_TITLE "Completed $(^Name) Setup"
96+
!define PG_FAIL_TITLE "Failed to Install $(^Name)"
97+
!define PG_COMPLETE_TEXT "$(^Name) has been installed on your computer."
98+
!define PG_SYS_FAIL_TEXT "The following ${PRODUCT_NAME} installation \
99+
requirements are not supported by this system:"
100+
!define PG_HOST_FAIL_TEXT "Attention: Only when the following system \
101+
configurations are completed can ${PRODUCT_NAME} run properly."
102+
!define PG_GUEST_FAIL_TEXT "There are still virtual machines running on \
103+
${PRODUCT_NAME}."
104+
!define PG_EXIT_TEXT "Click the Finish button to exit the Setup Wizard."
105+
!define PG_CPU_SUPPORT "Intel Processor (CPU)"
106+
!define PG_VMX_SUPPORT "Intel Virtualization Technology (VT-x)"
107+
!define PG_NX_SUPPORT "Execute Disable Bit (XD)"
108+
!define PG_EM64T_SUPPORT "Intel Extended Memory 64 Technology (EM64T)"
109+
!define PG_EPT_SUPPORT "Intel VT-x with Extended Page Tables (EPT)"
110+
!define PG_ENABLE_VMX "BIOS/UEFI: Enable Intel Virtualization Technology"
111+
!define PG_ENABLE_NX "BIOS/UEFI: Enable Execute Disable Bit"
112+
!define PG_OSVER_SUPPORT "Windows 7 or higher"
113+
!define PG_OSARCH_SUPPORT "32-bit or 64-bit version of Windows"
114+
!define PG_DISABLE_HYPERV "Windows: Disable Microsoft Hyper-V"
115+
!define PG_HOMEPAGE "${PRODUCT_NAME} Homepage: ${PRODUCT_WEBSITE}"
116+
!define PG_WIKIPAGE "View ${PRODUCT_NAME} wiki page to configure the \
117+
system"
118+
83119
# Constants
84120
# Environment flags
85121
!define ENV_FLAG_CPU_SUPPORTED 0x00000001

Installer/UI.nsh

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
!ifndef UI_NSH_
3232
!define UI_NSH_
3333

34-
!include "MUI.nsh"
34+
!include "MUI2.nsh"
3535

3636
!include 'Resources.nsh'
3737

@@ -41,8 +41,8 @@ ShowUnInstDetails show
4141

4242
Name "${PRODUCT_BRAND} ${PRODUCT_FULL_NAME}"
4343
BrandingText "${PRODUCT_BRAND} ${PRODUCT_NAME} v${PRODUCT_VERSION}"
44-
Caption "${PRODUCT_NAME} - Open Source Cross-Platform Hypervisor"
45-
UninstallCaption "${PRODUCT_BRAND} ${PRODUCT_NAME} Uninstall"
44+
Caption "${PRODUCT_NAME} - ${PRODUCT_DESCRIPTION}"
45+
UninstallCaption "${DLG_CAPTION_UN}"
4646
!ifdef INSTALL
4747
OutFile "haxm-${PRODUCT_VERSION}-setup.exe"
4848
!else
@@ -60,42 +60,94 @@ VIAddVersionKey LegalCopyright "${U+00A9} ${PRODUCT_YEAR} \
6060
VIAddVersionKey ProductName "${PRODUCT_BRAND} ${PRODUCT_FULL_NAME}"
6161
VIAddVersionKey ProductVersion "${PRODUCT_VERSION}"
6262

63-
!define MUI_ABORTWARNING
63+
!define MUI_ICON "res\haxm_logo.ico"
64+
!define MUI_UNICON "res\haxm_logo.ico"
65+
6466
!ifdef INSTALL
65-
!define MUI_CUSTOMFUNCTION_ABORT onAbort
66-
!endif
67-
!define MUI_ICON "res\haxm_logo.ico"
68-
!define MUI_UNICON "res\haxm_logo.ico"
69-
!define MUI_WELCOMEFINISHPAGE_BITMAP "res\cover.bmp"
67+
Var title
68+
Var text
69+
Var link
70+
Var url
71+
72+
!define MUI_WELCOMEFINISHPAGE_BITMAP "res\cover.bmp"
73+
!define MUI_ABORTWARNING
74+
!define MUI_CUSTOMFUNCTION_ABORT onAbort
7075

7176
# Welcome page
7277
!define MUI_WELCOMEPAGE_TITLE_3LINES
73-
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the \
74-
installation of $(^Name) (${PRODUCT_NAME}) ${PRODUCT_VERSION}. \
75-
${PRODUCT_NAME} is a hardware-assisted virtualization engine \
76-
(hypervisor), widely used as an accelerator for Android Emulator and \
77-
QEMU.\
78-
\r\n\r\nImportant: ${PRODUCT_NAME} requires an Intel CPU with certain \
79-
hardware features, including ${PRODUCT_BRAND} Virtualization \
80-
Technology (${PRODUCT_BRAND} VT), etc. This installer will check \
81-
whether your computer can run ${PRODUCT_NAME}."
78+
!define MUI_WELCOMEPAGE_TEXT "${PG_WELCOME_TEXT}"
8279

8380
# License page
84-
!define MUI_LICENSEPAGE_TEXT_BOTTOM "If you accept the terms of the license \
85-
agreement, click Install to continue $(^Name) setup."
81+
!define MUI_LICENSEPAGE_TEXT_BOTTOM "${PG_LICENSE_BOTTOM}"
8682
!define MUI_LICENSEPAGE_BUTTON "&Install"
8783

8884
# Finish page
85+
!define MUI_FINISHPAGE_TITLE "$title"
86+
!define MUI_FINISHPAGE_TEXT "$text$\r$\n$\r$\n${PG_EXIT_TEXT}"
8987
!define MUI_FINISHPAGE_TITLE_3LINES
90-
!define MUI_FINISHPAGE_LINK_LOCATION ${PRODUCT_WEBSITE}
91-
!define MUI_FINISHPAGE_LINK "${PRODUCT_NAME} Homepage: ${PRODUCT_WEBSITE}"
88+
!define MUI_FINISHPAGE_TEXT_LARGE
89+
!define MUI_FINISHPAGE_LINK "$link"
90+
!define MUI_FINISHPAGE_LINK_LOCATION "$url"
9291

9392
# Wizard dialogs
9493
!insertmacro MUI_PAGE_WELCOME
9594
!insertmacro MUI_PAGE_LICENSE "assets\LICENSE"
9695
!insertmacro MUI_PAGE_INSTFILES
96+
!define MUI_PAGE_CUSTOMFUNCTION_PRE onFinished
9797
!insertmacro MUI_PAGE_FINISH
98-
!ifndef INSTALL
98+
99+
# Wizard costom pages
100+
!macro List Item Flag
101+
IntOp $0 $status & ${Flag}
102+
${If} $0 != 0
103+
StrCpy $text "$text$\r$\n - ${Item}"
104+
${EndIf}
105+
!macroend
106+
107+
!define List `!insertmacro List`
108+
109+
Function LoadSuccessPage
110+
StrCpy $title "${PG_COMPLETE_TITLE}"
111+
StrCpy $text "${PG_COMPLETE_TEXT}"
112+
StrCpy $link "${PG_HOMEPAGE}"
113+
StrCpy $url "${PRODUCT_WEBSITE}"
114+
FunctionEnd
115+
116+
Function LoadSystemErrorPage
117+
StrCpy $title "${PG_FAIL_TITLE}"
118+
StrCpy $text "${PG_SYS_FAIL_TEXT}$\r$\n"
119+
120+
${List} "${PG_CPU_SUPPORT}" ${ENV_FLAG_CPU_SUPPORTED}
121+
${List} "${PG_VMX_SUPPORT}" ${ENV_FLAG_VMX_SUPPORTED}
122+
${List} "${PG_NX_SUPPORT}" ${ENV_FLAG_NX_SUPPORTED}
123+
${List} "${PG_EM64T_SUPPORT}" ${ENV_FLAG_EM64T_SUPPORTED}
124+
${List} "${PG_EPT_SUPPORT}" ${ENV_FLAG_EPT_SUPPORTED}
125+
${List} "${PG_OSVER_SUPPORT}" ${ENV_FLAG_OSVER_SUPPORTED}
126+
${List} "${PG_OSARCH_SUPPORT}" ${ENV_FLAG_OSARCH_SUPPORTED}
127+
128+
StrCpy $link "${PG_HOMEPAGE}"
129+
StrCpy $url "${PRODUCT_WEBSITE}"
130+
FunctionEnd
131+
132+
Function LoadHostErrorPage
133+
StrCpy $title "${PG_COMPLETE_TITLE}"
134+
StrCpy $text "${PG_HOST_FAIL_TEXT}$\r$\n"
135+
136+
${List} "${PG_ENABLE_VMX}" ${ENV_FLAG_VMX_ENABLED}
137+
${List} "${PG_ENABLE_NX}" ${ENV_FLAG_NX_ENABLED}
138+
${List} "${PG_DISABLE_HYPERV}" ${ENV_FLAG_HYPERV_DISABLED}
139+
140+
StrCpy $link "${PG_WIKIPAGE}"
141+
StrCpy $url "${PRODUCT_WEBSITE}${PRODUCT_WIKIPAGE}"
142+
FunctionEnd
143+
144+
Function LoadGuestErrorPage
145+
StrCpy $title "${PG_FAIL_TITLE}"
146+
StrCpy $text "${PG_GUEST_FAIL_TEXT}"
147+
StrCpy $link "${PG_HOMEPAGE}"
148+
StrCpy $url "${PRODUCT_WEBSITE}"
149+
FunctionEnd
150+
!else
99151
!insertmacro MUI_UNPAGE_INSTFILES
100152
!endif
101153

0 commit comments

Comments
 (0)