2010-11-28 2 views
1

PATH 변수를 업데이트하는 데 문제가 있습니다. 내가해야 할 일은 (잘 작동하는) 경로를 업데이트 한 다음 즉시 설치 프로그램에서 새 버전을 사용하는 것입니다. 이것은 작동하지 않습니다. 여기 동일한 설치 프로그램에서 업데이트 된 NSIS 경로 사용

내가 경로를 업데이트하기 위해 사용하고 무엇을 :

!macro ADD_TO_PATH pathAdd 
     DetailPrint "Adding ${pathAdd} to the system PATH." 
     ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH" 
     WriteRegStr ${WriteEnvStr_RegKey} "PATH" "$1;${pathAdd}" 
     SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 

     ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH" 
     MessageBox MB_OK "Path: $1" 

!macroend 

을 그리고 여기에 내가 그것으로해야 할 일이다

: EXEC_OUT 다음 인 경우

Section "${PRODUCT_NAME}" SEC_R 

     DetailPrint 'Installing Python Dateutil...' 
     !insertmacro EXEC_OUT 'dtutil' 'easy_install python-dateutil' 'DateUtil' 'true' 

SectionEnd 

; Silent execution of easy_install. 
; abrt - is set to 'true', causes Abort on failure. 
; name - user-friendly name to print 
; package - unique name for labels 
; what - full command to execute(ex: "easy_install packageXYZ") 
!macro EXEC_OUT package what name abrt 

     MessageBox MB_OK "what: ${what}" 
     ExecWait "${what}" $0 
     ${If} $0 == "0" 
      DetailPrint "${name} module installed successfully." 
     ${Else} 
       DetailPrint "${name} failed to install: $0" 
      ${If} ${abrt} == "true" 
        abort "An essential part of the installation, ${name}, failed to install. Aborting installation." 
      ${EndIf} 
     ${EndIf} 

!macroend 

왜 작동하지 않습니까? 응용 프로그램을 종료하기 전에 PATH를 업데이트 할 수 있습니까?

답변

관련 문제