есть такая задачка: написать скрипт который (после компиляции) будет запускать другой инсталятор nsis в тихом режиме и записать лог действий (не своих, а тех которые делает запускаемый инсталятор) в файл. С помощью других хороших людей сваял такой скриптик:
;Text/Registry definitions
!define PRODUCT_NAME "Nsis ïåðåõâàò"
!define PRODUCT_VERSION "1.0"
;includes
!include "MUI.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
SetCompressor /SOLID lzma
; MUI Settings
!define MUI_ABORTWARNING
;!define MUI_ICON "ico.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "Russian"
!define LVM_GETITEMCOUNT 0x1004
!define LVM_GETITEMTEXT 0x102D
Name "${PRODUCT_NAME}"
Caption "Ïåðåõâàò"
OutFile "${PRODUCT_NAME}.exe"
Function DumpLog
Exch $5
Push $0
Push $1
Push $2
Push $3
Push $4
Push $6
FindWindow $0 "#32770" "заголовок окна устанавливаемого инсталятора"
GetDlgItem $0 $0 1016
StrCmp $0 0 error
FileOpen $5 $5 "w"
StrCmp $5 0 error
SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $3
StrCpy $2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i \
(0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
loop: StrCmp $2 $6 done
System::Call "User32::SendMessageA(i, i, i, i) i \
($0, ${LVM_GETITEMTEXT}, $2, r1)"
System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
FileWrite $5 "$4$\r$\n"
IntOp $2 $2 + 1
Goto loop
done:
FileClose $5
System::Free $1
System::Free $3
Goto exit
error:
MessageBox MB_OK error
exit:
Pop $6
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
Exch $5
FunctionEnd
Section "Inst"
SetOutPath "$TEMP\files\"
File /r "Files.exe"
Execwait "$TEMP\files\files.exe /S"
SectionEnd
Section "-POST"
push "$DESKTOP\LOG.log"
Call DumpLog
SectionEnd
но он не работает... может поможет кто подправить?
;Text/Registry definitions
!define PRODUCT_NAME "Nsis ïåðåõâàò"
!define PRODUCT_VERSION "1.0"
;includes
!include "MUI.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
SetCompressor /SOLID lzma
; MUI Settings
!define MUI_ABORTWARNING
;!define MUI_ICON "ico.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
; Finish page
;!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "Russian"
!define LVM_GETITEMCOUNT 0x1004
!define LVM_GETITEMTEXT 0x102D
Name "${PRODUCT_NAME}"
Caption "Ïåðåõâàò"
OutFile "${PRODUCT_NAME}.exe"
Function DumpLog
Exch $5
Push $0
Push $1
Push $2
Push $3
Push $4
Push $6
FindWindow $0 "#32770" "заголовок окна устанавливаемого инсталятора"
GetDlgItem $0 $0 1016
StrCmp $0 0 error
FileOpen $5 $5 "w"
StrCmp $5 0 error
SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
System::Alloc ${NSIS_MAX_STRLEN}
Pop $3
StrCpy $2 0
System::Call "*(i, i, i, i, i, i, i, i, i) i \
(0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
loop: StrCmp $2 $6 done
System::Call "User32::SendMessageA(i, i, i, i) i \
($0, ${LVM_GETITEMTEXT}, $2, r1)"
System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
FileWrite $5 "$4$\r$\n"
IntOp $2 $2 + 1
Goto loop
done:
FileClose $5
System::Free $1
System::Free $3
Goto exit
error:
MessageBox MB_OK error
exit:
Pop $6
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
Exch $5
FunctionEnd
Section "Inst"
SetOutPath "$TEMP\files\"
File /r "Files.exe"
Execwait "$TEMP\files\files.exe /S"
SectionEnd
Section "-POST"
push "$DESKTOP\LOG.log"
Call DumpLog
SectionEnd
но он не работает... может поможет кто подправить?