Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для wolkow70

Ветеран


Сообщения: 3206
Благодарности: 845

Профиль | Отправить PM | Цитировать


Копаюсь с функцией InstallFolderInternal из любимого VLC.
И вот, что интересно:

Var UninstallLog
!macro OpenUninstallLog
FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
FileSeek $UninstallLog 0 END
!macroend

!macro CloseUninstallLog
FileClose $UninstallLog
SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
!macroend

!macro InstallFile FILEREGEX
File "${FILEREGEX}"
!define Index 'Line${__LINE__}'
FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
StrCmp $0 "" "${Index}-End"
"${Index}-Loop:"
StrCmp $1 "" "${Index}-End"
FileWrite $UninstallLog "$1$\r$\n"
FindNext $0 $1
Goto "${Index}-Loop"
"${Index}-End:"
!undef Index
!macroend
;
!macro InstallFolder FOLDER
File /r "${FOLDER}"
Push "${FOLDER}"
Call InstallFolderInternal
!macroend
;
Function InstallFolderInternal
Pop $9
!define Index 'Line${__LINE__}'
FindFirst $0 $1 "$INSTDIR\$9\*"
StrCmp $0 "" "${Index}-End"
"${Index}-Loop:"
StrCmp $1 "" "${Index}-End"
StrCmp $1 "." "${Index}-Next"
StrCmp $1 ".." "${Index}-Next"
IfFileExists "$9\$1\*" 0 "${Index}-Write"
Push $0
Push $9
Push "$9\$1"
Call InstallFolderInternal
Pop $9
Pop $0
Goto "${Index}-Next"
"${Index}-Write:"
FileWrite $UninstallLog "$9\$1$\r$\n"
"${Index}-Next:"
FindNext $0 $1
Goto "${Index}-Loop"
"${Index}-End:"
!undef Index
FunctionEnd
;
Section "!${PRODUCT_NAME}" Install
SectionIn 1 2 3 RO
SetShellVarContext all
SetOutPath "$INSTDIR"

!insertmacro OpenUninstallLog

ЕСЛИ файл скрипта лежит в одной директории с файлами установки и при этом прописать так:

!insertmacro InstallFile vlc.exe
!insertmacro InstallFile vlc.exe.manifest
!insertmacro InstallFile libvlc.dll
!insertmacro InstallFile libvlc.dll.manifest

То при установке устанавливаемые файлы в логе UninstallLog прописываются .

А, если файл скрипта поместить в другую папку и прописать пути к файлам:

!insertmacro InstallFile "${FILEPATH}\vlc\vlc.exe"
!insertmacro InstallFile "${FILEPATH}\vlc\vlc.exe.manifest"
!insertmacro InstallFile "${FILEPATH}\vlc\libvlc.dll"
!insertmacro InstallFile "${FILEPATH}\vlc\libvlc.dll.manifest"

То инсталляция происходит нормально, но списка файлов в UninstallLog нет

В чем дело не пойму .... Может кто знает в чем заковырка?

-------
Человек человеку - друг, товарищ и волк!


Отправлено: 10:08, 17-06-2011 | #1262