2016-12-19 1 views
1

,이 라인 :NSIS 3에서 UAC_AsUser_ExecShell로 오류를 수정하는 방법은 무엇입니까? 새 버전 3, 2.46 유니 코드로 작동하는 NSI 스크립트를 사용하려고

!undef: "_UAC_ParseDefineFlags_orin_f2" not defined! 
Error in macro _UAC_ParseDefineFlags_orin on macroline 12 
Error in macro _UAC_ParseDefineFlags_Begin on macroline 6 
Error in macro _UAC_ParseDefineFlagsToInt on macroline 1 
Error in macro UAC_AsUser_Call on macroline 5 
Error in macro UAC_AsUser_ExecShell on macroline 11 
Error in script "c:\my.nsi" on line 308 -- aborting creation process 

There is a similar, unanswered question, 백 년 전에 :

!insertmacro UAC_AsUser_ExecShell '' '$INSTDIR\test.exe' '--openbrowser' '' SW_SHOWNORMAL 

다음과 같은 오류가 발생합니다.

내 질문 :

어떻게 NSIS 3으로 UAC plug-in를 사용하는?

+0

아마도 @Anders는 쉽게 질문 할 수 있습니다. –

+2

짧은 대답은이 플러그인을 사용하지 않는다는 것입니다. – Anders

+0

아주 좋아요! 답장을 보내 주셔서 감사합니다. 아마 NSIS-3에 플러그인과 같은 기능을하는 내장 된 방법이 없을 것입니다. –

답변

1

내가 NSIS의 v3.01에서 UAC_Basic.nsi의 간단한 복제하여 오류를 재현 할 수 위키에서 UAC 플러그인 v0.2.4c (20150526) 사용 :

Unicode true 
!addplugindir ".\plugins\x86-unicode" ; Only required if you have not copied the .dll 

!define S_NAME "UAC minimal test ${NSIS_PACKEDVERSION}" 

Name "${S_NAME}" 
OutFile "${S_NAME}.exe" 
RequestExecutionLevel user ; << Required, you cannot use admin! 
InstallDir "$ProgramFiles\${S_NAME}" 


!include UAC.nsh 
!include MUI2.nsh 

!macro Init thing 
uac_tryagain: 
!insertmacro UAC_RunElevated 
${Switch} $0 
${Case} 0 
    ${IfThen} $1 = 1 ${|} Quit ${|} ;we are the outer process, the inner process has done its work, we are done 
    ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;we are admin, let the show go on 
    ${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user 
     MessageBox mb_YesNo|mb_IconExclamation|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, try again" /SD IDNO IDYES uac_tryagain IDNO 0 
    ${EndIf} 
    ;fall-through and die 
${Case} 1223 
    MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "This ${thing} requires admin privileges, aborting!" 
    Quit 
${Case} 1062 
    MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Logon service not running, aborting!" 
    Quit 
${Default} 
    MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate , error $0" 
    Quit 
${EndSwitch} 

SetShellVarContext all 
!macroend 

Function .onInit 
!insertmacro Init "installer" 
FunctionEnd 


!insertmacro MUI_PAGE_WELCOME 
!insertmacro MUI_PAGE_DIRECTORY 
!insertmacro MUI_PAGE_INSTFILES 
!define MUI_FINISHPAGE_RUN 
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun 
!insertmacro MUI_PAGE_FINISH 

!insertmacro MUI_LANGUAGE "English" 

Section 
SectionEnd 


Function PageFinishRun 
!insertmacro UAC_AsUser_ExecShell '' '$WinDir\notepad.exe' '--openbrowser' '' SW_SHOWNORMAL 
FunctionEnd 
+0

'Unicode true '가 나에게 새 것처럼 보인다. 아마도 NSIS 2에서 3으로 스크립트를 마이그레이션하는 것에 대해 더 자세히 읽어야합니다. –

-1

오래된 파기를 스레드 :

위키의 UAC 플러그인은 NSIS 2.x에서 사용했던 버전과 비교할 때 약간의 변화가있었습니다.

그 작은 변화로 인해 문제가 해결되었습니다.

+0

그래서 어떤 변화가 있었습니까? –

관련 문제