11!include MUI2.nsh
22!include FileFunc.nsh
33
4+ !define app_name " Vial"
5+ !define author " Vial KB"
6+
47; --------------------------------
58; Perform Machine-level install, if possible
69
@@ -31,7 +34,7 @@ FunctionEnd
3134; General
3235
3336 Name " ${app_name}"
34- OutFile " ..\${installer} "
37+ OutFile " ..\..\..\VialSetup.exe "
3538
3639; --------------------------------
3740; Interface Settings
@@ -49,7 +52,7 @@ FunctionEnd
4952 !define MUI_FINISHPAGE_RUN
5053 !define MUI_FINISHPAGE_RUN_CHECKED
5154 !define MUI_FINISHPAGE_RUN_TEXT " Run ${app_name}"
52- !define MUI_FINISHPAGE_RUN_FUNCTION " LaunchLink "
55+ !define MUI_FINISHPAGE_RUN_FUNCTION " LaunchAsNonAdmin "
5356 !insertmacro MUI_PAGE_FINISH
5457
5558 !insertmacro MUI_UNPAGE_CONFIRM
@@ -67,7 +70,7 @@ FunctionEnd
6770 " Software\Microsoft\Windows\CurrentVersion\Uninstall\${app_name}"
6871Section
6972 SetOutPath " $InstDir"
70- File /r " ..\${app_name}\*"
73+ File /r " ..\..\..\dist\ ${app_name}\*"
7174 WriteRegStr SHCTX " Software\${app_name}" " " $InstDir
7275 WriteUninstaller " $InstDir\uninstall.exe"
7376 CreateShortCut " $SMPROGRAMS\${app_name}.lnk" " $InstDir\${app_name}.exe"
@@ -99,7 +102,6 @@ Section "Uninstall"
99102
100103SectionEnd
101104
102- Function LaunchLink
103- !addplugindir " ."
104- ShellExecAsUser::ShellExecAsUser " open" " $SMPROGRAMS\${app_name}.lnk"
105+ Function LaunchAsNonAdmin
106+ Exec ' "$WINDIR\explorer.exe" "$InstDir\${app_name}.exe"'
105107FunctionEnd
0 commit comments