-
Notifications
You must be signed in to change notification settings - Fork 13
/
PageFinish.nsh
61 lines (52 loc) · 2.2 KB
/
PageFinish.nsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; Function SetupFinishPage
;
; This function gets called before the finish page is shown. It
; creates different controls on the finish page depending on
; whether the installer thinks a reboot is needed or not.
Function SetupFinishPage
ReadINIStr $R0 "$PLUGINSDIR\ioHowLS.ini" "Field 4" "State" ;Field 4 is Don't set shell
; IF (Don't set as shell != TRUE)
IntCmp $R0 1 +7 ;Tick and disable the "Run Litestep" checkbox when Litestep is set as shell
StrCmp $hasStartedLS "true" +7
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Field 4" "State" "1"
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Field 4" "Flags" "DISABLED"
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Field 4" "Top" "-3200"
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Field 4" "Bottom" "-3199"
GoTo doneSettingUp
; ELSE IF ($hasStartedLS == TRUE)
StrCmp $hasStartedLS "true" 0 doneSettingUp
; Remove the "Run LiteStep" checkbox. LiteStep is already running.
; The box is not checked, so the "FinishRun" function will not run.
WriteINIStr "$PLUGINSDIR\ioSpecial.ini" "Settings" "NumFields" "3"
doneSettingUp:
FunctionEnd
Function FinishRun
ReadRegDWORD $R7 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "AutoRestartShell"
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "AutoRestartShell" 0
${If} $currentShell == "litestep.exe"
Push "$INSTDIR"
Call KillLS
${Else}
KillProcDLL::KillProc $currentShell
Sleep 2000
${EndIf}
ExecShell open "$INSTDIR\litestep.exe" ;Launch LiteStep
; Wait for LiteStep to start
StrCpy $0 "0"
Sleep 500
FindProcDLL::FindProc "litestep.exe"
IntOp $0 $0 + 1
StrCmp $0 10 +2
StrCmp $R0 1 +1 -5
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "AutoRestartShell" $R7
FunctionEnd
!define MUI_PAGE_CUSTOMFUNCTION_PRE SetupFinishPage
;!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowFinishPage
;!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ValidateFinish
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT $(RUN_LS)
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION FinishRun
!insertmacro MUI_PAGE_FINISH