1 | SetCompressor lzma |
---|
2 | |
---|
3 | !include "WinVer.nsh" |
---|
4 | !include "WordFunc.nsh" |
---|
5 | !include "MUI2.nsh" |
---|
6 | !include "LogicLib.nsh" |
---|
7 | |
---|
8 | |
---|
9 | Name "redirect-test 0.1" |
---|
10 | OutFile "redirect-test.exe" |
---|
11 | InstallDir "C:\Users\samuli\opt\nsistest" |
---|
12 | ShowInstDetails show |
---|
13 | |
---|
14 | !insertmacro MUI_PAGE_COMPONENTS |
---|
15 | !insertmacro MUI_PAGE_DIRECTORY |
---|
16 | !insertmacro MUI_PAGE_INSTFILES |
---|
17 | !insertmacro MUI_PAGE_FINISH |
---|
18 | |
---|
19 | Section "Main" |
---|
20 | ; Get location of cmd.exe |
---|
21 | ReadEnvStr $R0 COMSPEC |
---|
22 | nsExec::ExecToLog '"$R0" /c "$SYSDIR\sc.exe" start openvpnserviceinteractive >nul' |
---|
23 | Pop $R0 |
---|
24 | ${If} "$R0" == "0" |
---|
25 | DetailPrint "Enabling OpenVPNService succeeded" |
---|
26 | ${Else} |
---|
27 | DetailPrint "WARNING: $\"sc.exe start OpenVPNServiceInteractive$\" failed with return value of $R0" |
---|
28 | ${EndIf} |
---|
29 | SectionEnd |
---|