2016-12-19 7 views
1

2.46ユニコードで動作NSIスクリプトは、新しいバージョン3には、このラインを使用しようとすると:バック年前から、NSIS 3のUAC_AsUser_ExecShellでエラーを修正する方法は?

!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

これはおそらく@アンダーにとって簡単な質問です。 –

+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

古い掘りをスレッド:

私は同じ問題を抱えていました.WikiのUACプラグインは、NSIS 2.xで使用していたバージョンと比べて小さな変更点があります。

小さな変更で問題が解決しました

+0

どのような変更でしたか? –

関連する問題