Page MenuHomePhabricator

No OneTemporary

Size
79 KB
Referenced Files
None
Subscribers
None
diff --git a/trunk/NSIS/fred.nsh b/trunk/NSIS/fred.nsh
new file mode 100644
index 0000000..5ea15d8
--- /dev/null
+++ b/trunk/NSIS/fred.nsh
@@ -0,0 +1,875 @@
+; -----------------------------------------------------------------------------
+; Excelsior Installation Toolkit (EIT) engine
+; -----------------------------------------------------------------------------
+
+!ifndef EIT_INCLUDED
+!define EIT_INCLUDED
+
+!define _EITFUNC_UN
+
+; -----------------------------------------------------------------------------
+; Include text functions support
+
+!include "TextFunc.nsh"
+
+
+; -----------------------------------------------------------------------------
+!macro MUI_LANGUAGE_EIT LANGUAGE
+
+ ;Include a language
+
+ !verbose push
+ !verbose ${MUI_VERBOSE}
+
+ !if ${LANGUAGE} == "Brazilian"
+ !insertmacro MUI_LANGUAGE PortugueseBR
+ !else
+ !insertmacro MUI_LANGUAGE ${LANGUAGE}
+ !endif
+
+ ;Include language file
+ !insertmacro LANGFILE_INCLUDE_WITHDEFAULT "${PROJECT_SHORT_NAME}_Lng${LANGUAGE}.nsh" "${PROJECT_SHORT_NAME}_LngEnglish.nsh"
+
+ !verbose pop
+
+!macroend
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_CALL_PREINSTALL INSTALL_CALLBACK_DLL
+
+ InitPluginsDir
+ SetOutPath $PLUGINSDIR
+
+ File "/oname=eit_install.dll" "${INSTALL_CALLBACK_DLL}"
+
+ System::Call '$PLUGINSDIR\eit_install.dll::_PreInstall@4(t "$INSTDIR")i .r0'
+ ${if} $0 == "error"
+ System::Call '$PLUGINSDIR\eit_install.dll::PreInstall(t "$INSTDIR")i .r0'
+ ${endif}
+ ${if} $0 != 0
+ Abort "Unexpected error in installation script"
+ ${endif}
+
+!macroend
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_CALL_POSTINSTALL
+
+ System::Call '$PLUGINSDIR\eit_install.dll::_PostInstall@4(t "$INSTDIR")i .r0 ? u'
+ ${if} $0 == "error"
+ System::Call '$PLUGINSDIR\eit_install.dll::PostInstall(t "$INSTDIR")i .r0 ? u'
+ ${endif}
+ ${if} $0 != 0
+ Abort "Unexpected error in installation script"
+ ${endif}
+
+!macroend
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_CALL_PREUNINSTALL UNINSTALL_CALLBACK_DLL
+
+ ;-- System::Call can't process paths with round brackets in "Program Filex(x86)"
+ ;-- so convert path to 8.3 form:
+ GetFullPathName /SHORT $1 "${UNINSTALL_CALLBACK_DLL}"
+
+ System::Call '$1::_PreUninstall@0()i ().r0 ? u'
+ ${if} $0 == "error"
+ System::Call '$1::PreUninstall()i ().r0 ? u'
+ ${endif}
+ ${if} $0 != 0
+ Abort "Unexpected error in uninstallation script"
+ ${endif}
+
+ Delete "${UNINSTALL_CALLBACK_DLL}"
+
+!macroend
+
+
+
+;------------------------------------------------------------------------------
+
+!define EIT_LOG_MODE_FILE "File "
+!define EIT_LOG_MODE_DIRECTORY "Folder " ; created folder. remove if empty, else log "can't remove folder" warning
+!define EIT_LOG_MODE_DIRECTORY_R "FolderR " ; recuesive remove this folder
+!define EIT_LOG_MODE_REGISTRY_VAL "RegValue"
+!define EIT_LOG_MODE_REGISTRY "Registry"
+!define EIT_LOG_MODE_REGISTRY_CONTEXT "InstType"
+
+!define EIT_LENGTH_LOG_MODE 8
+
+; -----------------------------------------------------------------------------
+; Declaration of variables
+
+Var eit.InstallLogHandle
+Var eit.RegistryContext
+
+
+;------------------------------------------------------------------------------
+!macro EIT_WRITE_LOG_FILE_STR STR
+
+ ${if} "${STR}" != ""
+ FileWrite $eit.InstallLogHandle "${STR}$\r$\n"
+ ${endif}
+
+!macroend
+!define EIT_WriteLogFileStr '!insertmacro EIT_WRITE_LOG_FILE_STR'
+
+
+;------------------------------------------------------------------------------
+!macro EIT_WRITE_LOG_FILE_STR_NO_NEWLINE STR
+
+ ${if} "${STR}" != ""
+ FileWrite $eit.InstallLogHandle "${STR}"
+ ${endif}
+
+!macroend
+!define EIT_WriteLogFileStrNoNewline '!insertmacro EIT_WRITE_LOG_FILE_STR_NO_NEWLINE'
+
+;------------------------------------------------------------------------------
+!macro EIT_WRITE_LOG_FILE TYPE VALUE
+
+ FileWrite $eit.InstallLogHandle "${TYPE} ${VALUE}$\r$\n"
+
+!macroend
+!define EIT_WriteLogFile '!insertmacro EIT_WRITE_LOG_FILE'
+
+
+;------------------------------------------------------------------------------
+; Adds file(s) to be extracted to the specified output name.
+!macro EIT_ADD_FILE DST_FILE SRC_FILE
+ StrCpy $0 $KeepOnUninstall
+
+ File "/oname=${DST_FILE}" "${SRC_FILE}"
+ ${if} $KeepOnUninstall == 0
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_FILE}" "${DST_FILE}"
+ ${endif}
+
+!macroend
+!define EIT_AddFile '!insertmacro EIT_ADD_FILE'
+
+
+;========= isFileExists() =====================================================
+; (* ${FileExists} does not understands last slashes in directory name *)
+; In $1 - filename
+; Out $1 - 1 or 0
+!macro EIT_IS_FILE_EXISTS
+ Push $0
+ Push $2
+
+ !define ID3445 ${__LINE__}
+ StrLen $2 $1 ; $2 := length("c:\a\b\\")
+loop_${ID3445}:
+ StrCpy $0 $1 "" -1 ; $0 := last '\'
+ StrCmp $0 "\" cut_${ID3445} ; if ($0 == "\") goto cut_${ID3445}
+ StrCmp $0 "/" cut_${ID3445} ; if ($0== "/") goto cut_${ID3445}
+ StrCmp $0 " " cut_${ID3445} ; if ($0 == " ") goto cut_${ID3445}
+
+ ${if} ${FileExists} $1
+ StrCpy $1 1
+ ${else}
+ StrCpy $1 0
+ ${endif}
+
+ Pop $2
+ Pop $0
+ goto return_${ID3445}
+cut_${ID3445}:
+ StrCpy $1 $1 -1 ; cut last char from $1
+ goto loop_${ID3445}
+return_${ID3445}:
+ !undef ID3445
+
+!macroend
+!define EIT_isFileExists '!insertmacro EIT_IS_FILE_EXISTS'
+
+
+;------------------------------------------------------------------------------
+; Postinstall runnable registration (forms function PostinstallRun() and
+; registers it as MUI_FINISHPAGE_RUN_FUNCTION
+;
+!macro EIT_POSTINSTALL_RUN POSTINSTALL_RUN_DIR POSTINSTALL_RUN_EXE POSTINSTALL_RUN_ARG
+ !define MUI_FINISHPAGE_RUN
+ !define MUI_FINISHPAGE_RUN_FUNCTION PostinstallRun
+
+ Function PostinstallRun
+ Push $0
+ Push $1
+ Push $OUTDIR
+ StrCpy $OUTDIR "${POSTINSTALL_RUN_DIR}"
+ StrCpy $0 "${POSTINSTALL_RUN_EXE}"
+ StrCpy $1 "${POSTINSTALL_RUN_ARG}"
+ ExecShell "" "$0" "$1"
+ Pop $OUTDIR
+ Pop $1
+ Pop $0
+ FunctionEnd ; PostinstallRun
+!macroend
+!define EIT_PostinstallRun '!insertmacro EIT_POSTINSTALL_RUN'
+
+
+
+; -----------------------------------------------------------------------------
+; Creates a shortcut 'link.lnk' that links to 'target.file',
+; with optional parameters 'parameters'.
+!macro EIT_CREATE_SHORTCUT LNK_FILE TARGET_FILE PARAMETERS WORKING_DIR
+
+ ; $OUTDIR is used for the working directory. You can change
+ ; it by using SetOutPath before creating the Shortcut.
+ Push $OUTDIR
+ SetOutPath '${WORKING_DIR}'
+
+ CreateShortCut "${LNK_FILE}" "${TARGET_FILE}" ${PARAMETERS}
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_FILE}" "${LNK_FILE}"
+
+ Pop $0
+ SetOutPath $0
+
+!macroend
+!define EIT_CreateShortCut '!insertmacro EIT_CREATE_SHORTCUT'
+
+
+; -----------------------------------------------------------------------------
+; Sets the context of $SMPROGRAMS and other shell folders.
+; 0/1 = the 'current user'/'all users' shell folders are used.
+!macro EIT_SET_COMMON_INSTALL_TYPE IS_COMMON
+
+ ${if} ${IS_COMMON} != 0
+ SetShellVarContext "all"
+ StrCpy $eit.RegistryContext "all"
+ ${else}
+ SetShellVarContext "current"
+ StrCpy $eit.RegistryContext "current"
+ ${endif}
+
+!macroend
+!define EIT_SetCommonInstallType '!insertmacro EIT_SET_COMMON_INSTALL_TYPE'
+
+
+
+; -----------------------------------------------------------------------------
+; Log new registry key if it was not exists before
+!macro EIT_LOG_REGISTRY_KEY ROOT_KEY SUBKEY
+
+ ClearErrors
+ EnumRegKey $0 "${ROOT_KEY}" "${SUBKEY}" "0"
+ ${if} ${Errors}
+ ClearErrors
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_REGISTRY}" "${ROOT_KEY} ${SUBKEY}"
+ ${endif}
+
+!macroend
+!define EIT_LogRegistryKey '!insertmacro EIT_LOG_REGISTRY_KEY'
+
+; -----------------------------------------------------------------------------
+; Log registry value
+!macro EIT_LOG_REGISTRY_VAL ROOT_KEY SUBKEY VAL_NAME
+
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_REGISTRY_VAL}" "${ROOT_KEY} ${SUBKEY}*${VAL_NAME}"
+
+!macroend
+!define EIT_LogRegistryVal '!insertmacro EIT_LOG_REGISTRY_VAL'
+
+; -----------------------------------------------------------------------------
+; Write a dword (32 bit integer) to the registry.
+; Only short names of root keys are allowed.
+!macro EIT_WRITE_REGISTRY_DWORD ROOT_KEY SUBKEY VAL_NAME VALUE
+
+ ${EIT_LogRegistryKey} "${ROOT_KEY}" "${SUBKEY}"
+ ${EIT_LogRegistryVal} "${ROOT_KEY}" "${SUBKEY}" "${VAL_NAME}"
+ WriteRegDWORD "${ROOT_KEY}" "${SUBKEY}" "${VAL_NAME}" "${VALUE}"
+
+!macroend
+!define EIT_WriteRegDWORD '!insertmacro EIT_WRITE_REGISTRY_DWORD'
+
+
+; -----------------------------------------------------------------------------
+; Write a string to the registry.
+; Only short names of root keys are allowed.
+!macro EIT_WRITE_REGISTRY_STR ROOT_KEY SUBKEY VAL_NAME VALUE
+
+ ${EIT_LogRegistryKey} "${ROOT_KEY}" "${SUBKEY}"
+ ${EIT_LogRegistryVal} "${ROOT_KEY}" "${SUBKEY}" "${VAL_NAME}"
+ WriteRegStr "${ROOT_KEY}" "${SUBKEY}" "${VAL_NAME}" "${VALUE}"
+
+!macroend
+!define EIT_WriteRegStr '!insertmacro EIT_WRITE_REGISTRY_STR'
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_CREATE_FILE_ASSOCIATION FILE_EXT DESCRIPTION COMMAND ARGUMENTS ICON ICONIDX
+
+ ${EIT_WriteRegStr} HKCR "$(^Name).${FILE_EXT}" "" "${DESCRIPTION}"
+ ${EIT_WriteRegStr} HKCR "$(^Name).${FILE_EXT}\DefaultIcon" "" "${ICON},${ICONIDX}"
+ ${EIT_WriteRegStr} HKCR "$(^Name).${FILE_EXT}\Shell\open\command" "" "$\"${COMMAND}$\" ${ARGUMENTS}"
+ ${EIT_WriteRegStr} HKCR "$(^Name).${FILE_EXT}\Shell\open" "FriendlyAppName" "$(^Name)"
+ ${EIT_WriteRegStr} HKCR ".${FILE_EXT}" "" "$(^Name).${FILE_EXT}"
+
+!macroend
+!define EIT_CreateFileAssociation '!insertmacro EIT_CREATE_FILE_ASSOCIATION'
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_SHOW_FILE_ASSOCIATION_REQUEST FILE_EXT FILE_EXT_APPLICATION DESCRIPTION COMMAND ARGUMENTS
+ !define Index "Line${__LINE__}"
+
+ StrCpy $0 "${FILE_EXT}"
+ StrCpy $1 "${FILE_EXT_APPLICATION}"
+ MessageBox MB_YESNO "$(MSG_FILEEXTS_TEMPLATE)" IDNO "L_${Index}_SkipFileAssociation"
+
+ ${EIT_CreateFileAssociation} "${FILE_EXT}" "${DESCRIPTION}" "${COMMAND}" "${ARGUMENTS}"
+
+"L_${Index}_SkipFileAssociation:"
+
+ !undef Index
+!macroend
+!define EIT_ShowFileAssociationRequest '!insertmacro EIT_SHOW_FILE_ASSOCIATION_REQUEST'
+
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_FUNC_DECL_MkCleanupLogString
+
+ !ifndef MkCleanupLogString
+ !define MkCleanupLogString
+ ; -----------------------------------------------------------------------------
+ ; In:
+ ; $0 == "a\b" or ""
+ ; $1 == "c:\program files\a\c"
+ ; Out:
+ ; $0 == String to write to install.log
+ Function MkCleanupLogString
+ Push $1
+ ${EIT_isFileExists}
+ ${if} $1 == 0 ; Allow cleanup if install dir will be created
+ Pop $1
+ allow:
+ StrCpy $0 "${EIT_LOG_MODE_DIRECTORY_R} $1"
+ return
+ ${endif}
+ Pop $1
+
+ ; Install into existent directory - so cleanup is allowed only when $1 ends with $0:
+
+ StrLen $2 $0 ; $2 := length("a\b")
+ StrLen $3 $1 ; $3 := length("c:\program files\a\c")
+ ${if} $2 > 0
+ ${if} $3 > $2
+ IntOp $2 0 - $2 ; $2 := -$2
+ StrCpy $2 $1 "" $2 ; $2 := "a\c"
+ StrCmp $2 $0 allow ; if ("a\c" == "a\b") goto allow
+ ${endif}
+ ${endif}
+
+ StrCpy $0 ""
+ FunctionEnd ; MkCleanupLogString
+
+ !endif ; MkCleanupLogString
+
+!macroend ; EIT_FUNC_DECL_MkCleanupLogString
+
+
+;------------------------------------------------------------------------------
+; Determine if we'll need remove $INSTDIR recursively after uninstall and
+; push string like "FolderR c:\program files\a\b" or push "" if cleanup is not allowed
+!macro EIT_MK_CLEANUP_LOG_STRING DEFFOLDER FULLPATH
+
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+
+ StrCpy $1 "${FULLPATH}"
+ !ifdef DEFAULT_FOLDER
+ StrCpy $0 "${DEFFOLDER}"
+ !else
+ StrCpy $0 ""
+ !endif
+ Call MkCleanupLogString
+
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+!macroend
+!define EIT_MkCleanupLogStr '!insertmacro EIT_MK_CLEANUP_LOG_STRING'
+
+
+
+;------------------------------------------------------------------------------
+; If ${EXTRAROOT} folder in not exists then add to $0 string
+; like "FolderR c:\program files\a\b"
+!macro EIT_ADD_ROOT_CLEANUP_LOG_STRING EXTRAROOT
+ Push $1
+ StrLen $1 ${EXTRAROOT} ; $1 := length("c:\program files\a\b")
+ ${if} $1 > 3 ; more than "c:\" ({FileExists("c:\") returns FALSE!)
+ StrCpy $1 ${EXTRAROOT}
+ ${EIT_isFileExists}
+ ${if} $1 == 0 ; Allow cleanup if install dir will be created
+ StrCpy $0 "$0${EIT_LOG_MODE_DIRECTORY_R} ${EXTRAROOT}$\r$\n"
+ ${endif}
+ ${endif}
+ Pop $1
+!macroend
+!define EIT_AddRootCleanupLogStr '!insertmacro EIT_ADD_ROOT_CLEANUP_LOG_STRING'
+
+
+;------------------------------------------------------------------------------
+; In: stack = [delimeter char] [directory] [][]....
+; Out: stack = [String to write to install.log] [][]....
+Function SliceDir
+
+ Exch $0 ; chop char ; $0 := '\'
+ Exch
+ Exch $1 ; input string ; $1 := "c:\aa\bb.."
+ Push $2 ;
+ Push $3 ;
+ Push $4 ;
+ Push $5 ; .. and old $0..$5 are saved on stack
+
+ StrCpy $4 "" ; $4 := "" - accumulate string for install.log here
+ StrCpy $5 ""
+ StrCpy $2 2 ; $2 := 2 (to skip "c:\" chars )
+
+ loop: ; loop:
+ IntOp $2 $2 + 1 ; ++$2
+ StrCpy $3 $1 1 $2 ; $3 := $1[$2]
+ StrCmp $3 $0 nextpart ; if ($3 == '\') goto nextpart
+ StrCmp $3 "" nextpart0 ; if ($3 == '') goto nextpart0
+ StrCpy $5 "" ;
+ Goto loop ; goto loop
+ nextpart0:
+ StrCmp $5 $0 EOL ; To don't process "c:\zz" and "c:\zz\" twice
+ nextpart:
+ StrCpy $5 $1 $2 ; $5 := "c:\", "c:\aa", "c:\aa\bb" ...
+ ${if} $2 > 3 ; ignore "c:\"
+ ;-- create $5 and add log for it to $4
+ CreateDirectory "$5"
+ ${if} $4 != ""
+ StrCpy $4 "$4$\r$\n"
+ ${endif}
+ StrCpy $4 "$4${EIT_LOG_MODE_DIRECTORY} $5"
+ ;
+ ${endif}
+ StrCpy $5 $3 ; "\" or "" used to find possible "...\<EOL>"
+ StrCmp $3 $0 loop ; if ($3 == '\') goto loop
+ EOL:
+
+ StrCpy $0 $4
+
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0 ; restore $4..$0 and push log string
+
+FunctionEnd ; SliceDir
+
+;------------------------------------------------------------------------------
+; Out: stack = [String to write to install.log] ....
+!macro EIT_CREATE_DIR_RECURSIVELY1 DIRECTORY
+
+ Push "${DIRECTORY}"
+ Push "\"
+ Call SliceDir
+
+!macroend
+!define EIT_CreateDirRecursively1 '!insertmacro EIT_CREATE_DIR_RECURSIVELY1'
+
+
+;------------------------------------------------------------------------------
+; Creates recursively specified directory. Used to create project root and
+; shortcut directories
+; The error flag is set if the directory couldn't be created.
+; You should always specify an absolute path.
+!macro EIT_CREATE_DIR_RECURSIVELY DIR_NAME
+
+ Push $0
+ ${EIT_CreateDirRecursively1} "${DIR_NAME}"
+ Pop $0
+ ${if} $KeepOnUninstall == 0
+ ${EIT_WriteLogFileStr} "$0"
+ ${endif}
+ Pop $0
+
+!macroend
+!define EIT_CreateDirRecursively '!insertmacro EIT_CREATE_DIR_RECURSIVELY'
+
+;------------------------------------------------------------------------------
+; Creates the specified directory. Assumed that parent directory exists
+; at this time
+; The error flag is set if the directory couldn't be created.
+; You should always specify an absolute path.
+!macro EIT_CREATE_DIRECTORY DIR_NAME
+ Push $1
+ StrCpy $1 "${DIR_NAME}"
+ ${EIT_isFileExists}
+ ${if} $1 == 0
+ CreateDirectory "${DIR_NAME}"
+ ${if} $KeepOnUninstall == 0
+ StrLen $1 "${DIR_NAME}" ;
+ ${if} $1 > 3 ; more than "c:\"
+ ${EIT_WriteLogFileStr} "${EIT_LOG_MODE_DIRECTORY} ${DIR_NAME}"
+ ${endif}
+ ${endif}
+ ${endif}
+ Pop $1
+!macroend
+!define EIT_CreateDirectory '!insertmacro EIT_CREATE_DIRECTORY'
+
+
+;------------------------------------------------------------------------------
+; Open install log and create uninstaller
+!macro EIT_START_INSTALLATION UNINSTALLER_PATH UNINSTALLER_FILE CLEANUP_EXTRAROOTS_LOGSTRS
+
+ Push $R0
+ Push $R2
+
+ !ifdef CLEANUP_DIR
+ ${EIT_MkCleanupLogStr} "${DEFAULT_FOLDER}" "$INSTDIR"
+ Pop $R2
+ !else
+ StrCpy $R2 ""
+ !endif
+
+ ${if} '${UNINSTALLER_PATH}' != '$INSTDIR\'
+ ${EIT_CreateDirRecursively1} "${UNINSTALLER_PATH}" ; it includes $INSTDIR so both this directories will be created and logged
+ Pop $R0
+ ${else}
+ ${EIT_CreateDirRecursively1} "$INSTDIR"
+ Pop $R0
+ ${endif}
+
+ SetOutPath "$INSTDIR"
+
+L_OpenInstallLog:
+ ClearErrors
+ FileOpen $eit.InstallLogHandle "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}" "a"
+
+ ${if} ${Errors}
+ StrCpy $0 "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+ MessageBox MB_RETRYCANCEL|MB_ICONSTOP "$(^FileError_NoIgnore)" IDRETRY L_OpenInstallLog
+ Pop $R2
+ Pop $R0
+ Abort "$(^CantWrite) ${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+ ${else}
+ FileSeek $eit.InstallLogHandle 0 END
+ ${endif}
+
+ ${EIT_WriteLogFileStr} "$R2"
+ ${EIT_WriteLogFileStrNoNewline} "${CLEANUP_EXTRAROOTS_LOGSTRS}"
+ ${EIT_WriteLogFileStr} "$R0"
+
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_FILE}" "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+
+ WriteUninstaller "${UNINSTALLER_PATH}${UNINSTALLER_FILE}"
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_FILE}" "${UNINSTALLER_PATH}${UNINSTALLER_FILE}"
+
+ Pop $R2
+ Pop $R0
+!macroend
+!define EIT_StartInstallation '!insertmacro EIT_START_INSTALLATION'
+
+
+;------------------------------------------------------------------------------
+!define UNINSTAL_REGISTRY_SUBKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
+
+; Close install log and add uninstall information to Add/Remove Programs
+!macro EIT_END_INSTALLATION COMPANY_NAME UNINSTALLER_PATH UNINSTALLER_FILE
+
+ ; Add uninstall information to Add/Remove Programs
+ ${EIT_WriteRegStr} SHCTX "${UNINSTAL_REGISTRY_SUBKEY}" "DisplayName" "$(^Name)"
+ ${EIT_WriteRegStr} SHCTX "${UNINSTAL_REGISTRY_SUBKEY}" "UninstallString" "${UNINSTALLER_PATH}${UNINSTALLER_FILE}"
+ ${EIT_WriteRegStr} SHCTX "${UNINSTAL_REGISTRY_SUBKEY}" "Publisher" "${COMPANY_NAME}"
+ ${EIT_WriteRegDWORD} SHCTX "${UNINSTAL_REGISTRY_SUBKEY}" "NoModify" 1
+ ${EIT_WriteRegDWORD} SHCTX "${UNINSTAL_REGISTRY_SUBKEY}" "NoRepair" 1
+
+
+ ${EIT_WriteLogFile} "${EIT_LOG_MODE_REGISTRY_CONTEXT}" "$eit.RegistryContext"
+
+ FileClose $eit.InstallLogHandle
+ SetFileAttributes "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}" SYSTEM|HIDDEN
+
+!macroend
+!define EIT_EndInstallation '!insertmacro EIT_END_INSTALLATION'
+
+
+;------------------------------------------------------------------------------
+; Close and remove install log
+!macro EIT_ABORT_INSTALLATION UNINSTALLER_PATH UNINSTALLER_FILE
+
+ FileClose $eit.InstallLogHandle
+
+ ClearErrors
+ FileOpen $eit.InstallLogHandle "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}" "a"
+
+ ${ifnot} ${Errors}
+ FileClose $eit.InstallLogHandle
+ ${EIT_ExecuteUninstall} "${UNINSTALLER_PATH}"
+ ${endif}
+
+ Delete "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+ Delete "${UNINSTALLER_PATH}${UNINSTALLER_FILE}"
+
+!macroend
+!define EIT_AbortInstallation '!insertmacro EIT_ABORT_INSTALLATION'
+
+
+;------------------------------------------------------------------------------
+!macro EIT_ExecWait CMD_LINE
+
+ ExecWait '${CMD_LINE}' $0
+
+ ${if} $0 > 0
+ Abort 'Failed to execute ${CMD_LINE} (exit code = $0)'
+ ${endif}
+
+!macroend
+!define EIT_ExecWait '!insertmacro EIT_ExecWait'
+
+;------------------------------------------------------------------------------
+!macro EIT_ExecWaitIgnoreErrors CMD_LINE
+
+ ExecWait '${CMD_LINE}' $0
+
+!macroend
+!define EIT_ExecWaitIgnoreErrors '!insertmacro EIT_ExecWaitIgnoreErrors'
+
+
+;------------------------------------------------------------------------------
+; SUBKEY_VALNAME is <SUBKEY>*<VAL_NAME>
+
+!macro EIT_DELETE_REG_VAL ROOT_KEY SUBKEY_VALNAME
+ Push $1
+ Push $2
+ Push $3
+ StrCpy $1 0 ; position
+ ;LOOP:
+ IntOp $1 $1 + 1 ; ++$1
+ StrCpy $3 ${SUBKEY_VALNAME} 1 $1 ; $3 := SUBKEY_VALNAME[$1]
+ StrCmp $3 "*" +4 ; if ($3 == '*') goto FOUND
+ StrCmp $3 "" +2 ; if ($3 == '') goto ERROR
+ Goto -4 ; goto LOOP
+ ;ERROR:
+ StrCpy $1 -1
+ ;FOUND:
+
+ ;-- Now $1 == '*' position in SUBKEY_VALNAME or -1
+ ${if} $1 > 0
+ StrCpy $2 ${SUBKEY_VALNAME} $1 0 ; $2 := SUBKEY_VALNAME[0..($1-1)] == <SUBKEY>
+ IntOp $1 $1 + 1 ; ++$1
+ StrCpy $3 ${SUBKEY_VALNAME} "" $1 ; $3 := SUBKEY_VALNAME[$1..] == <VAL_NAME>
+ DeleteRegValue "${ROOT_KEY}" "$2" "$3"
+ ${endif}
+
+ Pop $3
+ Pop $2
+ Pop $1
+!macroend
+!define EIT_DeleteRegVal '!insertmacro EIT_DELETE_REG_VAL'
+
+;------------------------------------------------------------------------------
+!macro CASE_DELETE_REGISTRY_KEY ROOT_KEY SUBKEY
+
+ ${case} "${ROOT_KEY}"
+ DeleteRegKey "${ROOT_KEY}" "${SUBKEY}"
+ ${break}
+
+!macroend
+!define case_DeleteRegistryKey '!insertmacro CASE_DELETE_REGISTRY_KEY'
+
+;------------------------------------------------------------------------------
+!macro CASE_DELETE_REGISTRY_VAL ROOT_KEY SUBKEY_VALNAME
+
+ ${case} "${ROOT_KEY}"
+ ${EIT_DeleteRegVal} "${ROOT_KEY}" "${SUBKEY_VALNAME}"
+ ${break}
+
+!macroend
+!define case_DeleteRegistryVal '!insertmacro CASE_DELETE_REGISTRY_VAL'
+
+
+;------------------------------------------------------------------------------
+; Function EIT_ExecuteUninstall is called when installtion has failed or
+; the user invoked the uninstallion process.
+!macro EIT_ExecuteUninstall
+ !ifndef ${_EITFUNC_UN}EIT_ExecuteUninstall
+ !define ${_EITFUNC_UN}EIT_ExecuteUninstall '!insertmacro ${_EITFUNC_UN}EIT_ExecuteUninstallCall'
+ !insertmacro ${_EITFUNC_UN}TrimNewLines
+
+ Function ${_EITFUNC_UN}EIT_ExecuteUninstall
+ Pop $1 ; install.log file
+
+ StrCpy $0 0 ; line count
+
+
+ DetailPrint "$(^Exec) $1"
+
+ ;-------------------------------
+ ; reading the install log
+
+ ClearErrors
+
+L_UN_OpenInstallLog:
+ SetFileAttributes "$1" NORMAL
+ FileOpen $R0 "$1" r
+
+ ${if} ${Errors}
+ MessageBox MB_RETRYCANCEL|MB_ICONSTOP "$(MSG_UNABLE_TO_READ_FILE)" IDRETRY L_UN_OpenInstallLog
+ Abort "$(MSG_UNABLE_TO_READ_FILE)"
+ ${endif}
+
+ loop:
+ FileRead $R0 $R1
+ ${if} ${Errors}
+ goto endloop
+ ${endif}
+ ${${_EITFUNC_UN}TrimNewLines} "$R1" $R1
+ Push $R1
+ IntOp $0 $0 + 1 ; line count ++
+ goto loop
+ endloop:
+
+ FileClose $R0
+
+ ;-------------------------------
+ ; executing the install log
+
+
+ ${while} $0 > 0
+
+ IntOp $0 $0 - 1 ; line count --
+
+ Pop $R0 ; current line
+ ; DetailPrint $R0
+
+ IntOp $R3 ${EIT_LENGTH_LOG_MODE} + 1
+ StrCpy $R1 $R0 ${EIT_LENGTH_LOG_MODE} ; mode
+ StrCpy $R2 $R0 "" $R3 ; operand(s)
+
+ ClearErrors
+
+ ${switch} $R1
+ ${case} "${EIT_LOG_MODE_FILE}"
+ DetailPrint "$(^Delete): $R2"
+ Delete "$R2"
+ ${break}
+
+ ${case} "${EIT_LOG_MODE_DIRECTORY}"
+ DetailPrint "^RemoveFolder: $R2"
+ RMDir "$R2"
+ ${break}
+
+ ${case} "${EIT_LOG_MODE_DIRECTORY_R}"
+ DetailPrint "^CleanFolder: $R2"
+ RMDir /r "$R2"
+ ${break}
+
+ ${case} "${EIT_LOG_MODE_REGISTRY_VAL}"
+
+ StrCpy $R3 $R2 4 ; root
+ StrCpy $R4 $R2 "" 5 ; registry key
+ DetailPrint "^Unregistering value: $R3 $R4"
+
+ ${switch} $R3
+ ${case_DeleteRegistryVal} "HKCR" "$R4"
+ ${case_DeleteRegistryVal} "HKLM" "$R4"
+ ${case_DeleteRegistryVal} "HKCU" "$R4"
+ ${case_DeleteRegistryVal} "HKCC" "$R4"
+ ${case_DeleteRegistryVal} "HKDD" "$R4"
+
+ ${case} "HKU "
+ StrCpy $R4 $R2 "" 4 ; registry key
+ ${EIT_DeleteRegVal} HKU "$R4"
+ ${break}
+
+ ${case} "SHCT"
+ StrCpy $R4 $R2 "" 6 ; registry key
+ ${EIT_DeleteRegVal} SHCTX "$R4"
+ ${break}
+
+ ${endswitch}
+ ${break}
+
+ ${case} "${EIT_LOG_MODE_REGISTRY}"
+ StrCpy $R3 $R2 4 ; root
+ StrCpy $R4 $R2 "" 5 ; registry key
+ DetailPrint "^Unregistering: $R3 $R4"
+
+ ${switch} $R3
+ ${case_DeleteRegistryKey} "HKCR" "$R4"
+ ${case_DeleteRegistryKey} "HKLM" "$R4"
+ ${case_DeleteRegistryKey} "HKCU" "$R4"
+ ${case_DeleteRegistryKey} "HKCC" "$R4"
+ ${case_DeleteRegistryKey} "HKDD" "$R4"
+
+ ${case} "HKU "
+ StrCpy $R4 $R2 "" 4 ; registry key
+ DeleteRegKey HKU "$R4"
+ ${break}
+
+ ${case} "SHCT"
+ StrCpy $R4 $R2 "" 6 ; registry key
+ DeleteRegKey SHCTX "$R4"
+ ${break}
+
+ ${endswitch}
+ ${break}
+
+ ${case} "${EIT_LOG_MODE_REGISTRY_CONTEXT}"
+ ${if} $R2 == "all"
+ SetShellVarContext all
+ ${else}
+ SetShellVarContext current
+ ${endif}
+ ${break}
+
+ ${endswitch}
+
+ ${endwhile}
+
+ System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0) v'
+ FunctionEnd ; un.EIT_ExecuteUninstall
+
+ !endif
+!macroend ; EIT_ExecuteUninstall
+
+
+;------------------------------------------------------------------------------
+!macro un.EIT_ExecuteUninstall
+ !ifndef un.EIT_ExecuteUninstall
+ !undef _EITFUNC_UN
+ !define _EITFUNC_UN 'un.'
+
+ !insertmacro EIT_ExecuteUninstall
+
+ !undef _EITFUNC_UN
+ !define _EITFUNC_UN
+ !endif
+!macroend
+
+
+;------------------------------------------------------------------------------
+!macro EIT_ExecuteUninstallCall UNINSTALLER_PATH
+
+ Push "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+ Call EIT_ExecuteUninstall
+
+!macroend
+
+;------------------------------------------------------------------------------
+!macro un.EIT_ExecuteUninstallCall UNINSTALLER_PATH
+
+ Push "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}"
+ Call un.EIT_ExecuteUninstall
+
+!macroend
+
+;------------------------------------------------------------------------------
+!insertmacro EIT_ExecuteUninstall
+!insertmacro un.EIT_ExecuteUninstall
+
+!endif ; EIT_INCLUDED
diff --git a/trunk/NSIS/fred.nsi b/trunk/NSIS/fred.nsi
new file mode 100644
index 0000000..32b74dd
--- /dev/null
+++ b/trunk/NSIS/fred.nsi
@@ -0,0 +1,320 @@
+; installer.nsi
+; Generated by Excelsior Installer v2.2
+; Mon Jun 25 20:24:47 CEST 2012
+; -----------------------------------------------------------------------------
+; The installation script based on NSIS modern user interface
+; -----------------------------------------------------------------------------
+;
+!define PROJECT_ROOT_PATH "C:\Documents and Settings\gida\Desktop\fred-0.1.0beta4"
+!define PROJECT_NSIS_PATH "${PROJECT_ROOT_PATH}\NSIS"
+!define PROJECT_NSIS_RESOURCES_PATH "${PROJECT_NSIS_PATH}\resources"
+!define PROJECT_LONG_NAME "Forensic Registry EDitor"
+!define PROJECT_SHORT_NAME "fred"
+!define PROJECT_VERSION "0.1.0beta4"
+!define PROJECT_DEF_INSTDIR "$PROGRAMFILES\\${PROJECT_SHORT_NAME}"
+
+!define PACKAGENAME "${PROJECT_SHORT_NAME}-${PROJECT_VERSION}"
+!define EIT_LOG_FILENAME "nsis_install.log"
+!define DEF_SHORTCUTS_EXISTS
+;
+; -----------------------------------------------------------------------------
+; Include Modern UI, logic statements, file functions and EIT support
+!include "MUI2.nsh"
+!include "x64.nsh"
+!include "LogicLib.nsh"
+!include "FileFunc.nsh"
+!include "${PROJECT_SHORT_NAME}.nsh"
+!include "${PROJECT_SHORT_NAME}_PageInstallType.nsh"
+!include "${PROJECT_SHORT_NAME}_PageShortcuts.nsh"
+!include "${PROJECT_SHORT_NAME}_PageInstallInfo.nsh"
+;
+; -----------------------------------------------------------------------------
+; Configuration of the installation script
+!define COMPANY_NAME ""
+!define DEFAULT_PROGRAM_FOLDER "\${PROJECT_SHORT_NAME}"
+; Valid values for installation type: "auto" | "askuser" | "common" | "private"
+!define DESIRED_INSTALL_TYPE "auto"
+!define REGISTRY_KEY_NAME "Software\\${PROJECT_SHORT_NAME}"
+!define LICENSE_TEXT_FILE "\\?\${PROJECT_NSIS_RESOURCES_PATH}\license.txt"
+!define UNINSTALLER_RELPATH ""
+!define UNINSTALLER_FILE_NAME "Uninstall.exe"
+!define UNINSTALLER_PATH "$INSTDIR\${UNINSTALLER_RELPATH}"
+; -----------------------------------------------------------------------------
+; Declaration of variables
+Var IsCommonInstallation
+Var KeepOnUninstall
+Var InstlDirWasNotEdited
+Var LastDefaultInstalllDir
+Var StartMenuFolder
+; -----------------------------------------------------------------------------
+; General Attributes
+Name "${PROJECT_LONG_NAME}" "${PROJECT_LONG_NAME}"
+OutFile "\\?\${PROJECT_NSIS_PATH}\${PROJECT_SHORT_NAME}-${PROJECT_VERSION}-win32.exe"
+
+; Default installation folder
+InstallDir "${PROJECT_DEF_INSTDIR}"
+
+; Version Information
+VIAddVersionKey "CompanyName" ""
+VIAddVersionKey "LegalCopyright" "Copyright (c) 2011-2012 by Gillen Daniel"
+VIAddVersionKey "ProductName" "${PROJECT_LONG_NAME}"
+VIAddVersionKey "ProductVersion" "${PROJECT_VERSION}"
+VIAddVersionKey "FileDescription" "${PROJECT_SHORT_NAME} ${PROJECT_VERSION}"
+VIAddVersionKey "FileVersion" "${PROJECT_VERSION}"
+VIProductVersion "0.1.0.0"
+
+; The installer will perform a CRC on itself before allowing an install
+CRCCheck on
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+BrandingText ""
+; -----------------------------------------------------------------------------
+; Interface Attributes and Settings
+; The interface settings provided by the NSIS compiler itself (such as
+; LicenseText, Icon, CheckBitmap, InstallColors) should not be used in
+; Modern UI scripts. The Modern UI provides equalivent or extended
+; versions of these settings.
+!define MUI_ABORTWARNING
+!define MUI_WELCOMEPAGE_TITLE_3LINES
+!define MUI_FINISHPAGE_TITLE_3LINES
+!define MUI_UNICON "${PROJECT_NSIS_RESOURCES_PATH}\xuninst.ico"
+
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_RIGHT
+
+!define MUI_HEADERIMAGE_BITMAP "${PROJECT_NSIS_RESOURCES_PATH}\xinst_header.bmp"
+!define MUI_HEADERIMAGE_UNBITMAP "${PROJECT_NSIS_RESOURCES_PATH}\xinst_header.bmp"
+
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${PROJECT_NSIS_RESOURCES_PATH}\xinst_page.bmp"
+
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${PROJECT_NSIS_RESOURCES_PATH}\xuninst_page.bmp"
+
+!define MUI_WELCOMEPAGE_TITLE "$(MSG_WELCOMEPAGE_TITLE)"
+!define MUI_WELCOMEPAGE_TEXT "$(MSG_WELCOMEPAGE_TEXT)"
+
+; -----------------------------------------------------------------------------
+; Installer Page Settings
+; Do not display the checkbox to disable the creation of Start Menu shortcuts.
+!define MUI_STARTMENUPAGE_NODISABLE
+!ifdef MUI_FINISHPAGE_RUN
+ !define MUI_FINISHPAGE_RUN_TEXT "$(MSG_FINISHPAGE_RUN_TEXT)"
+!endif
+!ifdef MUI_FINISHPAGE_SHOWREADME
+ !define MUI_FINISHPAGE_SHOWREADME_TEXT "$(MSG_FINISHPAGE_SHOWREADME_TEXT)"
+!endif
+!ifdef FEATURE_REBOOT_NEEDED
+ !define MUI_FINISHPAGE_TEXT_REBOOT "$(MSG_FINISHPAGE_REBOOT_TEXT)"
+ !define MUI_FINISHPAGE_TEXT_REBOOTNOW "$(MSG_FINISHPAGE_REBOOT_NOW)"
+ !define MUI_FINISHPAGE_TEXT_REBOOTLATER "$(MSG_FINISHPAGE_REBOOT_LATER)"
+!endif
+; Declaration of folder for shortcuts
+${EIT_MUI_PAGE_SHORTCUTS_AddFolder} EIT_MUI_SHORTCUT_FOLDER_DESKTOP
+; -----------------------------------------------------------------------------
+!ifdef CLEANUP_DIR
+ !insertmacro EIT_FUNC_DECL_MkCleanupLogString
+!endif
+; -----------------------------------------------------------------------------
+; If $INSTDIR was never edited by user - update it to default value to accept
+; installation type changes
+Function UpdateInstallDir
+ ${if} $InstlDirWasNotEdited != 0
+ StrCmp "$INSTDIR" "$LastDefaultInstalllDir" instdir_not_changed
+ StrCpy $InstlDirWasNotEdited 0 ; oops. it was changed. turn this auto-update off
+ Return
+instdir_not_changed:
+ StrCpy $INSTDIR "${PROJECT_DEF_INSTDIR}"
+ StrCpy $LastDefaultInstalllDir "$INSTDIR"
+ ${endif}
+FunctionEnd ; UpdateInstallDir
+; -----------------------------------------------------------------------------
+; Call at exit from MUI_PAGE_WELCOME:
+Function CheckAdminRights
+ Push $R1
+ StrCpy $R1 ${DESIRED_INSTALL_TYPE}
+ ; EIT_CheckAdminRights():
+ ; In: R1 = ${DESIRED_INSTALL_TYPE}
+ ; Out: R1 = 1/0 - Admin/NoAdmin
+ ; (OR exit with 'Admin rigths required' message)
+ Call EIT_CheckAdminRights
+ ${if} $R1 != 0
+ ${if} ${DESIRED_INSTALL_TYPE} != "personal"
+ ${EIT_SetCommonInstallType} 1 ; by default it was 0
+ Call UpdateInstallDir
+ ${endif}
+ ${endif}
+ Pop $R1
+FunctionEnd ; CheckAdminRights
+; -----------------------------------------------------------------------------
+; Call at exit from EIT_MUI_PAGE_INSTALLTYPE:
+Function AcceptInstallType
+ ${EIT_SetCommonInstallType} $IsCommonInstallation
+ Call UpdateInstallDir
+FunctionEnd ; AcceptInstallType
+; -----------------------------------------------------------------------------
+; Installer Pages
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckAdminRights
+!insertmacro MUI_PAGE_WELCOME
+!ifdef LICENSE_TEXT_FILE
+ !insertmacro MUI_PAGE_LICENSE "${LICENSE_TEXT_FILE}"
+!endif
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE AcceptInstallType
+!insertmacro EIT_MUI_PAGE_INSTALLTYPE $IsCommonInstallation
+!insertmacro MUI_PAGE_DIRECTORY
+!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${DEFAULT_PROGRAM_FOLDER}"
+ !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
+!insertmacro EIT_MUI_PAGE_SHORTCUTS EIT_CreateShortCut
+!insertmacro EIT_MUI_PAGE_INSTALLINFO $StartMenuFolder \
+ EIT_MUI_PAGE_SHORTCUTS_GetInstallInfo
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+; -----------------------------------------------------------------------------
+; Uninstaller Page Settings
+!ifdef UNINSTALL_FEEDBACK_URL
+ !define MUI_FINISHPAGE_TEXT "$(MSG_FEEDBACK_TEXT)"
+ !define MUI_FINISHPAGE_SHOWREADME ${UNINSTALL_FEEDBACK_URL}
+ !define MUI_FINISHPAGE_SHOWREADME_TEXT "$(MSG_FEEDBACK_CHK_TEXT)"
+!endif
+; -----------------------------------------------------------------------------
+; Uninstaller Pages
+!insertmacro MUI_UNPAGE_WELCOME
+; !insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+; -----------------------------------------------------------------------------
+; Languages
+##SUPPORTED_LANGUAGES
+!insertmacro MUI_LANGUAGE_EIT "English"
+;!insertmacro MUI_LANGUAGE_EIT "Czech"
+;!insertmacro MUI_LANGUAGE_EIT "French"
+;!insertmacro MUI_LANGUAGE_EIT "German"
+;!insertmacro MUI_LANGUAGE_EIT "Italian"
+;!insertmacro MUI_LANGUAGE_EIT "Japanese"
+;!insertmacro MUI_LANGUAGE_EIT "Polish"
+;!insertmacro MUI_LANGUAGE_EIT "Brazilian"
+;!insertmacro MUI_LANGUAGE_EIT "Russian"
+;!insertmacro MUI_LANGUAGE_EIT "Spanish"
+; -----------------------------------------------------------------------------
+; Reserve Files
+ ;If you are using solid compression, files that are required before
+;the actual installation should be stored first in the data block,
+;because this will make your installer start faster.
+ !insertmacro MUI_RESERVEFILE_LANGDLL
+; -----------------------------------------------------------------------------
+; Installer Sections
+Section "Installer Section"
+ Push $0
+ StrCpy $0 "" ; collect cleanup directopy log strings in $0
+ StrCpy $KeepOnUninstall 0
+ ; Call pre-install action of install customization DLL if it was
+ ; specified in the project
+ !ifdef INSTALL_CALLBACK_DLL
+ !insertmacro EIT_CALL_PREINSTALL "${INSTALL_CALLBACK_DLL}"
+ !endif
+ ; Set $OUTPATH, open install log and create uninstaller
+ ${EIT_StartInstallation} "${UNINSTALLER_PATH}" "${UNINSTALLER_FILE_NAME}" "$0"
+ ; Add package files to be extracted to the output path
+ ${EIT_CreateDirectory} "$INSTDIR\report_templates"
+ ${EIT_AddFile} "$INSTDIR\report_templates\NTUSER_RecentDocs.qs" "${PROJECT_ROOT_PATH}\report_templates\NTUSER_RecentDocs.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\NTUSER_TypedUrls.qs" "${PROJECT_ROOT_PATH}\report_templates\NTUSER_TypedUrls.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\NTUSER_WindowsLiveAccounts.qs" "${PROJECT_ROOT_PATH}\report_templates\NTUSER_WindowsLiveAccounts.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\SAM_UserAccounts.qs" "${PROJECT_ROOT_PATH}\report_templates\SAM_UserAccounts.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\SOFTWARE_WindowsVersion.qs" "${PROJECT_ROOT_PATH}\report_templates\SOFTWARE_WindowsVersion.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\SYSTEM_CurrentNetworkSettings.qs" "${PROJECT_ROOT_PATH}\report_templates\SYSTEM_CurrentNetworkSettings.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\SYSTEM_SystemTimeInfo.qs" "${PROJECT_ROOT_PATH}\report_templates\SYSTEM_SystemTimeInfo.qs"
+ ${EIT_AddFile} "$INSTDIR\report_templates\SYSTEM_UsbStorageDevices.qs" "${PROJECT_ROOT_PATH}\report_templates\SYSTEM_UsbStorageDevices.qs"
+ ${EIT_AddFile} "$INSTDIR\fred.exe" "${PROJECT_ROOT_PATH}\fred.exe"
+ ${EIT_AddFile} "$INSTDIR\libgcc_s_dw2-1.dll" "${PROJECT_ROOT_PATH}\libgcc_s_dw2-1.dll"
+ ${EIT_AddFile} "$INSTDIR\libiconv-2.dll" "${PROJECT_ROOT_PATH}\libiconv-2.dll"
+ ${EIT_AddFile} "$INSTDIR\mingwm10.dll" "${PROJECT_ROOT_PATH}\mingwm10.dll"
+ ${EIT_AddFile} "$INSTDIR\phonon4.dll" "${PROJECT_ROOT_PATH}\phonon4.dll"
+ ${EIT_AddFile} "$INSTDIR\QtCore4.dll" "${PROJECT_ROOT_PATH}\QtCore4.dll"
+ ${EIT_AddFile} "$INSTDIR\QtGui4.dll" "${PROJECT_ROOT_PATH}\QtGui4.dll"
+ ${EIT_AddFile} "$INSTDIR\QtNetwork4.dll" "${PROJECT_ROOT_PATH}\QtNetwork4.dll"
+ ${EIT_AddFile} "$INSTDIR\QtScript4.dll" "${PROJECT_ROOT_PATH}\QtScript4.dll"
+ ${EIT_AddFile} "$INSTDIR\QtWebKit4.dll" "${PROJECT_ROOT_PATH}\QtWebKit4.dll"
+ StrCpy $KeepOnUninstall 0
+ ; Create registry key
+ !ifdef REGISTRY_KEY_NAME
+ ${EIT_WriteRegStr} SHCTX "${REGISTRY_KEY_NAME}" "InstallPath" "$INSTDIR"
+ !endif
+ ; Create Start Menu shortcuts
+ !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+ ${EIT_CreateDirRecursively} "$SMPROGRAMS\$StartMenuFolder"
+ ${EIT_CreateShortCut} \
+ "$SMPROGRAMS\$StartMenuFolder\fred.lnk" "$INSTDIR\fred.exe" \
+ '""' "$INSTDIR"
+
+ ${EIT_CreateShortCut} \
+ "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" \
+ '""' "$INSTDIR"
+
+ !insertmacro MUI_STARTMENU_WRITE_END
+
+ ${EIT_MUI_PAGE_SHORTCUTS_CreateShortcut} EIT_MUI_SHORTCUT_FOLDER_DESKTOP \
+ "\fred.lnk" "$INSTDIR\fred.exe" \
+ '""' "$INSTDIR"
+ ; Call post-install action of install customization DLL if it was
+ ; specified in the project
+ !ifdef INSTALL_CALLBACK_DLL
+ !insertmacro EIT_CALL_POSTINSTALL
+ !endif
+ !ifdef FEATURE_REBOOT_NEEDED
+ SetRebootFlag true
+ !endif
+ Pop $0
+ System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0) v'
+SectionEnd ; Installer Sections
+; -----------------------------------------------------------------------------
+; Customization of install NSIS callbacks
+Function .onInit
+ StrCpy $InstlDirWasNotEdited 1
+ !ifdef SPLASH_FILE
+ InitPluginsDir
+ File /oname=$PLUGINSDIR\splash.bmp "${SPLASH_FILE}"
+ splash::show 1000 $PLUGINSDIR\splash
+ Pop $0
+ !endif
+ !ifdef REGISTRY_KEY_NAME
+ ReadRegStr $R0 HKLM "${REGISTRY_KEY_NAME}" "InstallPath"
+ ${if} $R0 == ''
+ ClearErrors
+ ReadRegStr $R0 HKCU "${REGISTRY_KEY_NAME}" "InstallPath"
+ ${endif}
+ ${if} $R0 != ''
+ ClearErrors
+ FileOpen $R0 "${UNINSTALLER_PATH}${EIT_LOG_FILENAME}" "r"
+ ${if} ${Errors}
+ ClearErrors
+ ${else}
+ FileClose $R0
+ MessageBox MB_YESNO "$(MSG_PREV_INST_FOUND)" IDYES L_DoInstall
+ Quit
+L_DoInstall:
+ ${endif}
+ ${endif}
+ !endif
+ StrCpy $LastDefaultInstalllDir $INSTDIR
+FunctionEnd
+; -----------------------------------------------------------------------------
+Function .onInstFailed
+ ${EIT_AbortInstallation} "${UNINSTALLER_PATH}" "${UNINSTALLER_FILE_NAME}"
+FunctionEnd
+; -----------------------------------------------------------------------------
+Function .onInstSuccess
+ ${EIT_EndInstallation} "${COMPANY_NAME}" "${UNINSTALLER_PATH}" "${UNINSTALLER_FILE_NAME}"
+FunctionEnd
+; -----------------------------------------------------------------------------
+; Uninstaller Section
+Section "un.Uninstaller Section"
+ ; Call pre-uninstall action of uninstall customization DLL if it was
+ ; specified in the project
+ !ifdef UNINSTALL_CALLBACK_DLL
+ !endif
+ ; at this point the $INSTDIR contais the path to Uninstall.exe
+ ${un.EIT_ExecuteUninstall} "$INSTDIR\"
+ RMDir "$INSTDIR"
+SectionEnd ; Uninstaller Section
+; -----------------------------------------------------------------------------
+; Customization of uninstall NSIS callbacks
+Function un.onInit
+FunctionEnd
diff --git a/trunk/NSIS/fred_LngEnglish.nsh b/trunk/NSIS/fred_LngEnglish.nsh
new file mode 100644
index 0000000..45b3ef3
--- /dev/null
+++ b/trunk/NSIS/fred_LngEnglish.nsh
@@ -0,0 +1,55 @@
+; installer_LngEnglish.nsh
+; Generated by Excelsior Installer v2.2
+; Mon Jun 25 20:24:47 CEST 2012
+; -----------------------------------------------------------------------------
+; English localization for additional messages
+
+ !insertmacro LANGFILE "English" "English"
+
+ ${LangFileString} EIT_MUI_TEXT_INSTALLTYPE_HEADER "Installation type"
+ ${LangFileString} EIT_MUI_TEXT_INSTALLTYPE_SUBHEADER "Choose the type of installation"
+ ${LangFileString} EIT_MUI_TEXT_INSTALLTYPE_DESCRIPTION "Install this application for:"
+ ${LangFileString} EIT_MUI_TEXT_INSTALLTYPE_COMMON "Anyone who uses this computer"
+ ${LangFileString} EIT_MUI_TEXT_INSTALLTYPE_PERSONAL "Current user only"
+
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_HEADER "Shortcut icons"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_SUBHEADER "Select shortcuts you want to create"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_DESCRIPTION "Create shortcut icons in the following locations:"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_TODESKTOP "Desktop"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_TOQUICK "Quick Launch"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_TOSTARTMENU "Start Menu Root"
+ ${LangFileString} EIT_MUI_TEXT_SHORTCUTS_TOSTARTUP "Startup Folder"
+
+ ${LangFileString} EIT_MUI_TEXT_FILEASSOCIATION_HEADER "File extension associations"
+ ${LangFileString} EIT_MUI_TEXT_FILEASSOCIATION_SUBHEADER "Select file extensions you want to register"
+ ${LangFileString} EIT_MUI_TEXT_FILEASSOCIATION_DESCRIPTION "Register the following file extensions:"
+
+ ${LangFileString} EIT_MUI_TEXT_INFO_HEADER "Start installation"
+ ${LangFileString} EIT_MUI_TEXT_INFO_SUBHEADER "View current settings"
+ ${LangFileString} EIT_MUI_TEXT_INFO_DESCRIPTION "The installer is ready to install $0 on your computer. Click Next to begin the installation or Back to change the current settings listed below."
+ ${LangFileString} EIT_MUI_TEXT_INFO_DESCLABEL "Current settings:"
+
+
+ ${LangFileString} MSG_FILEEXTS_TEMPLATE "Associate *.$0 files with $1"
+ ${LangFileString} MSG_PREV_INST_FOUND "Previous installation of $(^Name) was found.$\r$\nIt is recommended to remove it before installing this version.$\r$\n$\r$\nDo you wish to continue without removing the previous installation?"
+
+ ${LangFileString} MSG_INFO_DESTINATION_DIRECTORY "Destination folder$\r$\n $0$\r$\n$\r$\n"
+ ${LangFileString} MSG_INFO_PROGRAM_FOLDER "Program folder $\r$\n $0$\r$\n$\r$\n"
+ ${LangFileString} MSG_INFO_SHORTCUTS_DESKTOP "Create shortcuts on the Desktop$\r$\n$\r$\n"
+ ${LangFileString} MSG_INFO_SHORTCUTS_STARTMENU "Create shortcuts in the Start Menu$\r$\n$\r$\n"
+ ${LangFileString} MSG_INFO_SHORTCUTS_QUICKLAUNCH "Create shortcuts on the Quick Launch$\r$\n$\r$\n"
+ ${LangFileString} MSG_INFO_SHORTCUTS_STARTUP "Create shortcuts in the Startup Folder$\r$\n$\r$\n"
+
+ ${LangFileString} MSG_FINISHPAGE_REBOOT_TEXT "Please, remove disks from drives and click Finish to complete setup."
+ ${LangFileString} MSG_FINISHPAGE_REBOOT_NOW "Yes, I want to restart my computer now."
+ ${LangFileString} MSG_FINISHPAGE_REBOOT_LATER "No, I will restart my computer later."
+
+ ${LangFileString} MSG_FEEDBACK_CHK_TEXT "Yes, take me to the feedback form when I click OK."
+
+ ${LangFileString} MSG_NO_RIGHTS "Administrator privileges are required to install this application"
+ ${LangFileString} MSG_UNABLE_TO_READ_FILE "Unable to read file $1"
+ ${LangFileString} MSG_WIN_64_REQUIRED "This installation package can be run on the 64-bit Windows only."
+
+
+ ${LangFileString} MSG_WELCOMEPAGE_TITLE "Welcome to ${PROJECT_LONG_NAME} v${PROJECT_VERSION} Installer"
+ ${LangFileString} MSG_WELCOMEPAGE_TEXT "This Installer will guide you through the installation of the software on your computer. To proceed, click Next."
diff --git a/trunk/NSIS/fred_PageInstallInfo.nsh b/trunk/NSIS/fred_PageInstallInfo.nsh
new file mode 100644
index 0000000..7d74e63
--- /dev/null
+++ b/trunk/NSIS/fred_PageInstallInfo.nsh
@@ -0,0 +1,178 @@
+; -----------------------------------------------------------------------------
+; Page Start Installation
+;
+; Export:
+; Macro EIT_MUI_PAGE_INSTALLINFO is used to set the Page.
+; -----------------------------------------------------------------------------
+
+!include MUI2.nsh
+!include LogicLib.nsh
+!include WinMessages.nsh
+!include FileFunc.nsh
+!include nsDialogs.nsh
+
+
+
+; -----------------------------------------------------------------------------
+; Page interface settings and variables
+!macro EIT_MUI_INSTALLINFOPAGE_INTERFACE
+
+ !ifndef EIT_MUI_INSTALLINFOPAGE_INTERFACE
+ !define EIT_MUI_INSTALLINFOPAGE_INTERFACE
+
+ Var eit.mui.InstallInfoPage
+ Var eit.mui.InstallInfoPage.Description
+ Var eit.mui.InstallInfoPage.Label
+ Var eit.mui.InstallInfoPage.EditText
+
+ !endif
+
+ !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAPS
+ !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+ !endif
+
+!macroend ; EIT_MUI_INSTALLINFOPAGE_INTERFACE
+
+
+; -----------------------------------------------------------------------------
+; Interface initialization
+!macro EIT_MUI_INSTALLINFOPAGE_GUIINIT
+
+ !ifndef EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLINFOPAGE_GUINIT
+ !define EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLINFOPAGE_GUINIT
+
+ Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.InstallInfoPage.GUIInit
+
+ !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT
+ Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}"
+ !endif
+
+ FunctionEnd ; eit.mui.InstallTypePage.GUIInit
+
+ !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.InstallInfoPage.GUIInit
+
+ !endif
+
+!macroend ; EIT_MUI_INSTALLINFOPAGE_GUIINIT
+
+
+; -----------------------------------------------------------------------------
+; Page declaration
+!macro EIT_MUI_PAGEDECLARATION_INSTALLINFO ${START_MENU_FOLDER} ${GET_SHORTCUT_INFO}
+
+ !insertmacro MUI_SET EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLINFOPAGE ""
+ !insertmacro EIT_MUI_INSTALLINFOPAGE_INTERFACE
+
+ !insertmacro EIT_MUI_INSTALLINFOPAGE_GUIINIT
+ !define EIT_MUI_INSTALLINFOPAGE_START_MENU_FOLDER ${START_MENU_FOLDER}
+ !define EIT_MUI_INSTALLINFOPAGE_GET_SHORTCUT_INFO ${GET_SHORTCUT_INFO}
+
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLINFOPAGE_HEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INFO_HEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLINFOPAGE_SUBHEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INFO_SUBHEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLINFOPAGE_DESCRIPTION "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INFO_DESCRIPTION)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLINFOPAGE_LABEL "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INFO_DESCLABEL)"
+
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_DESTINATION_DIRECTORY "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_DESTINATION_DIRECTORY)"
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_INFO_PROGRAM_FOLDER "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_PROGRAM_FOLDER)"
+
+ !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW
+
+ PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+ PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallInfoPage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallInfoPage.Leave_${MUI_UNIQUEID}
+
+ PageExEnd
+
+ !insertmacro EIT_MUI_FUNCTION_INSTALLINFOPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallInfoPage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallInfoPage.Leave_${MUI_UNIQUEID}
+
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLINFOPAGE_HEADER
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLINFOPAGE_SUBHEADER
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLINFOPAGE_DESCRIPTION
+
+ !insertmacro MUI_UNSET EIT_MUI_MSG_DESTINATION_DIRECTORY
+ !insertmacro MUI_UNSET EIT_MUI_MSG_INFO_PROGRAM_FOLDER
+
+!macroend ; EIT_MUI_PAGEDECLARATION_INSTALLINFO
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_MUI_PAGE_INSTALLINFO START_MENU_FOLDER GET_SHORTCUT_INFO
+
+ !verbose push
+ !verbose ${MUI_VERBOSE}
+
+ !insertmacro MUI_PAGE_INIT
+ !insertmacro EIT_MUI_PAGEDECLARATION_INSTALLINFO ${START_MENU_FOLDER} \
+ ${GET_SHORTCUT_INFO}
+
+ !verbose pop
+
+!macroend ; EIT_MUI_PAGE_INSTALLINFO
+
+
+; -----------------------------------------------------------------------------
+; Page functions
+!macro EIT_MUI_FUNCTION_INSTALLINFOPAGE PRE LEAVE
+
+ ; ---------------------------------------------------------------------------
+ Function "${PRE}"
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+ !insertmacro MUI_HEADER_TEXT_PAGE ${EIT_MUI_INSTALLINFOPAGE_HEADER} \
+ ${EIT_MUI_INSTALLINFOPAGE_SUBHEADER}
+
+ nsDialogs::Create /NOUNLOAD 1018
+ Pop $eit.mui.InstallInfoPage
+
+ ${if} $eit.mui.InstallInfoPage == error
+ Abort
+ ${endif}
+
+ ; Description text
+ StrCpy $0 "$(^Name)"
+ ${NSD_CreateLabel} 0u 0u 300u 24u "${EIT_MUI_INSTALLINFOPAGE_DESCRIPTION}"
+ Pop $eit.mui.InstallInfoPage.Description
+
+ ; Label text
+ ${NSD_CreateLabel} 0u 28u 300u 8u "${EIT_MUI_INSTALLINFOPAGE_LABEL}"
+ Pop $eit.mui.InstallInfoPage.Label
+
+ ; Info text
+ nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} \
+ ${DEFAULT_STYLES}|${ES_MULTILINE}|${WS_VSCROLL}|${ES_READONLY}|${WS_GROUP}|{SS_BLACKFRAME} \
+ ${WS_EX_STATICEDGE} \
+ 0u 40u 300u 98u ""
+ Pop $eit.mui.InstallInfoPage.EditText
+
+ StrCpy $0 "$INSTDIR"
+ StrCpy $R1 "${EIT_MUI_MSG_DESTINATION_DIRECTORY}"
+
+ !ifdef DEF_SHORTCUTS_EXISTS
+ StrCpy $0 "${EIT_MUI_INSTALLINFOPAGE_START_MENU_FOLDER}"
+ StrCpy $R1 "$R1${EIT_MUI_MSG_INFO_PROGRAM_FOLDER}"
+ !endif
+
+ ${${EIT_MUI_INSTALLINFOPAGE_GET_SHORTCUT_INFO}}
+ StrCpy $R1 "$R1$R0"
+
+ SendMessage $eit.mui.InstallInfoPage.EditText ${WM_SETTEXT} 0 "STR:$R1"
+
+; StrCpy $0 "1234"
+; SendMessage $eit.mui.InstallInfoPage.EditText ${WM_SETTEXT} 0 "STR:${EIT_MUI_MSG_INFO_PROGRAM_FOLDER}"
+
+ nsDialogs::Show
+
+ FunctionEnd ; PRE
+
+
+ ; ---------------------------------------------------------------------------
+ Function "${LEAVE}"
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+ FunctionEnd ; LEAVE
+
+!macroend ; EIT_MUI_FUNCTION_INSTALLINFOPAGE
diff --git a/trunk/NSIS/fred_PageInstallType.nsh b/trunk/NSIS/fred_PageInstallType.nsh
new file mode 100644
index 0000000..956fde2
--- /dev/null
+++ b/trunk/NSIS/fred_PageInstallType.nsh
@@ -0,0 +1,245 @@
+; -----------------------------------------------------------------------------
+; Page Istallation Type
+;
+; Export:
+; Function EIT_CheckAdminRights. It should be executed in the LEAVE
+; function of Page Welcom. If installation type common is required and
+; process has not administrator privileges the installation will be
+; terminated.
+;
+; Macro MUI_PAGE_INSTALLTYPE. It is used to set the page. It has one
+; argument a boolean variable. The value '1' will be assigned to the
+; given variable, if the common installation type should be used.
+; Otherwise the value '0' will be assigned.
+; -----------------------------------------------------------------------------
+
+!include MUI2.nsh
+!include LogicLib.nsh
+!include WinMessages.nsh
+!include FileFunc.nsh
+!include nsDialogs.nsh
+
+; -----------------------------------------------------------------------------
+; Declaration of variables
+
+Var eit.HasAdminRigth
+
+
+; -----------------------------------------------------------------------------
+; Check that administrator privileges are granted
+; Parameters: register $R1 must include disired installation type. The valid
+; values for installation type: "auto" | "askuser" | "common" | "private".
+; If installation type common is required and process has not administrator
+; privileges the installation will be terminated.
+Function EIT_CheckAdminRights
+; In: $R1 == ${DESIRED_INSTALL_TYPE}
+; Out: $R1 == 1/0 - Admin/NoAdmin
+
+ ; eit.HasAdminRigth := 1 only if the user has administrative rights:
+ StrCpy $eit.HasAdminRigth 0
+ ClearErrors
+ UserInfo::GetName
+ IfErrors Win9x
+ Goto WinOk
+ Win9x:
+ StrCpy $eit.HasAdminRigth 1
+ WinOk:
+ Pop $0
+ UserInfo::GetAccountType
+ Pop $1
+ ${if} $1 == "Admin"
+ StrCpy $eit.HasAdminRigth 1
+ ${endif}
+
+ ; It it is not have Admin rights and Common install type is selected then HALT
+ ${if} "$R1" == "common"
+ ${if} $eit.HasAdminRigth != 1
+ MessageBox MB_OK|MB_ICONSTOP "$(MSG_NO_RIGHTS)"
+ Quit
+ ${endif}
+ ${endif}
+ StrCpy $R1 "$eit.HasAdminRigth"
+FunctionEnd ; EIT_CheckAdminRights
+
+
+; -----------------------------------------------------------------------------
+; Page interface settings and variables
+!macro EIT_MUI_INSTALLTYPEPAGE_INTERFACE
+
+ !ifndef EIT_MUI_INSTALLTYPEPAGE_INTERFACE
+ !define EIT_MUI_INSTALLTYPEPAGE_INTERFACE
+
+ Var eit.mui.InstallTypePage
+ Var eit.mui.InstallTypePage.Description
+ Var eit.mui.InstallTypePage.Common
+ Var eit.mui.InstallTypePage.Personal
+
+ !endif
+
+ !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAPS
+ !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+ !endif
+
+!macroend ; EIT_MUI_INSTALLTYPEPAGE_INTERFACE
+
+
+; -----------------------------------------------------------------------------
+; Interface initialization
+!macro EIT_MUI_INSTALLTYPEPAGE_GUIINIT
+
+ !ifndef EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLTYPEPAGE_GUINIT
+ !define EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLTYPEPAGE_GUINIT
+
+ Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.InstallTypePage.GUIInit
+
+ !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT
+ Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}"
+ !endif
+
+ FunctionEnd ; eit.mui.InstallTypePage.GUIInit
+
+ !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.InstallTypePage.GUIInit
+
+ !endif
+
+!macroend ; EIT_MUI_INSTALLTYPEPAGE_GUIINIT
+
+
+; -----------------------------------------------------------------------------
+; Page declaration
+!macro EIT_MUI_PAGEDECLARATION_INSTALLTYPE ${COMMON_SELECTED}
+
+ !insertmacro MUI_SET EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLTYPEPAGE ""
+ !insertmacro EIT_MUI_INSTALLTYPEPAGE_INTERFACE
+
+ !insertmacro EIT_MUI_INSTALLTYPEPAGE_GUIINIT
+ !define EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED ${COMMON_SELECTED}
+
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLTYPEPAGE_HEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTALLTYPE_HEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLTYPEPAGE_SUBHEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTALLTYPE_SUBHEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLTYPEPAGE_DESCRIPTION "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTALLTYPE_DESCRIPTION)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLTYPEPAGE_COMMON "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTALLTYPE_COMMON)"
+ !insertmacro MUI_DEFAULT EIT_MUI_INSTALLTYPEPAGE_PERSONAL "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTALLTYPE_PERSONAL)"
+
+ !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW
+
+ PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+ PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallTypePage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallTypePage.Leave_${MUI_UNIQUEID}
+
+ PageExEnd
+
+ !insertmacro EIT_MUI_FUNCTION_INSTALLTYPEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallTypePage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_InstallTypePage.Leave_${MUI_UNIQUEID}
+
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLTYPEPAGE_HEADER
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLTYPEPAGE_SUBHEADER
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLTYPEPAGE_DESCRIPTION
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLTYPEPAGE_COMMON
+ !insertmacro MUI_UNSET EIT_MUI_INSTALLTYPEPAGE_PERSONAL
+
+!macroend ; EIT_MUI_PAGEDECLARATION_INSTALLTYPE
+
+
+; -----------------------------------------------------------------------------
+; Parameter COMMON_SELECTED must be a boolean variable. The value '1'
+; will be assigned to the given variable, if the common installation type
+; should be used. Otherwise the value '0' is assigned.
+!macro EIT_MUI_PAGE_INSTALLTYPE COMMON_SELECTED
+
+ !verbose push
+ !verbose ${MUI_VERBOSE}
+
+ !insertmacro MUI_PAGE_INIT
+ !insertmacro EIT_MUI_PAGEDECLARATION_INSTALLTYPE ${COMMON_SELECTED}
+
+ !verbose pop
+
+!macroend ; EIT_MUI_PAGE_INSTALLTYPE
+
+
+; -----------------------------------------------------------------------------
+; Page functions
+!macro EIT_MUI_FUNCTION_INSTALLTYPEPAGE PRE LEAVE
+
+ ; ---------------------------------------------------------------------------
+ Function "${PRE}"
+
+ ${switch} ${DESIRED_INSTALL_TYPE}
+ ${case} "common"
+ ${if} $eit.HasAdminRigth == 1
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 1
+ ${else}
+ MessageBox MB_OK|MB_ICONSTOP "Internal error: Admin expected" ; was not abandoned in CheckAdmin()?
+ Quit
+ ${endif}
+ Abort
+ ${break}
+
+ ${case} "personal"
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 0
+ Abort
+ ${break}
+
+ ${case} "auto"
+ ${if} $eit.HasAdminRigth == 1
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 1
+ ${else}
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 0
+ ${endif}
+ Abort
+ ${break}
+ ${endswitch}
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+
+ !insertmacro MUI_HEADER_TEXT_PAGE ${EIT_MUI_INSTALLTYPEPAGE_HEADER} \
+ ${EIT_MUI_INSTALLTYPEPAGE_SUBHEADER}
+
+ nsDialogs::Create /NOUNLOAD 1018
+ Pop $eit.mui.InstallTypePage
+
+ ${if} $eit.mui.InstallTypePage == error
+ Abort
+ ${endif}
+
+ ; Description text
+ ${NSD_CreateLabel} 0u 0u 300u 8u "${EIT_MUI_INSTALLTYPEPAGE_DESCRIPTION}"
+ Pop $eit.mui.InstallTypePage.Description
+
+ ; Radio buttons
+ ${NSD_CreateRadioButton} 16u 20u 284u 8u "${EIT_MUI_INSTALLTYPEPAGE_COMMON}"
+ Pop $eit.mui.InstallTypePage.Common
+
+ ${NSD_CreateRadioButton} 16u 36u 284u 8u "${EIT_MUI_INSTALLTYPEPAGE_PERSONAL}"
+ Pop $eit.mui.InstallTypePage.Personal
+
+ ${if} ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} != 0
+ ${NSD_Check} $eit.mui.InstallTypePage.Common
+ ${else}
+ ${NSD_Check} $eit.mui.InstallTypePage.Personal
+ ${endif}
+
+ nsDialogs::Show
+
+ FunctionEnd ; PRE
+
+
+ ; ---------------------------------------------------------------------------
+ Function "${LEAVE}"
+
+ ${NSD_GetState} $eit.mui.InstallTypePage.Common $R0
+
+ ${if} $R0 == ${BST_CHECKED}
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 1
+ ${else}
+ StrCpy ${EIT_MUI_INSTALLTYPEPAGE_COMMON_SELECTED} 0
+ ${endif}
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+ FunctionEnd ; LEAVE
+
+!macroend ; EIT_MUI_FUNCTION_INSTALLTYPEPAGE
diff --git a/trunk/NSIS/fred_PageShortcuts.nsh b/trunk/NSIS/fred_PageShortcuts.nsh
new file mode 100644
index 0000000..85957b3
--- /dev/null
+++ b/trunk/NSIS/fred_PageShortcuts.nsh
@@ -0,0 +1,374 @@
+; -----------------------------------------------------------------------------
+; Page Shortcut Icons
+;
+; Export:
+; Macro EIT_MUI_PAGE_SHORTCUTS is used to set the Page.
+; -----------------------------------------------------------------------------
+
+!include MUI2.nsh
+!include LogicLib.nsh
+!include WinMessages.nsh
+!include FileFunc.nsh
+!include nsDialogs.nsh
+
+; -----------------------------------------------------------------------------
+; Places where shortcuts can be created:
+
+!define EIT_MUI_SHORTCUT_FOLDER_DESKTOP DESKTOP
+!define EIT_MUI_SHORTCUT_FOLDER_QUICKLAUNCH QUICKLAUNCH
+!define EIT_MUI_SHORTCUT_FOLDER_STARTMENU STARTMENU
+!define EIT_MUI_SHORTCUT_FOLDER_STARTUP STARTUP
+
+!define EIT_MUI_SHORTCUT_STATE_ENABLE ${BST_CHECKED}
+
+; -----------------------------------------------------------------------------
+; Aply the givemn action to all possible shortcut entries
+!macro EIT_MUI_SHORTCUTS_ITERATE_ENTRIES ACTION ARGUMENTS
+
+ ${${ACTION}} ${EIT_MUI_SHORTCUT_FOLDER_DESKTOP} ${ARGUMENTS}
+ ${${ACTION}} ${EIT_MUI_SHORTCUT_FOLDER_QUICKLAUNCH} ${ARGUMENTS}
+ ${${ACTION}} ${EIT_MUI_SHORTCUT_FOLDER_STARTMENU} ${ARGUMENTS}
+ ${${ACTION}} ${EIT_MUI_SHORTCUT_FOLDER_STARTUP} ${ARGUMENTS}
+
+!macroend
+!define EIT_MUI_SHORTCUTS_IterateEntries '!insertmacro EIT_MUI_SHORTCUTS_ITERATE_ENTRIES'
+
+
+; -----------------------------------------------------------------------------
+; Define variables and mocros for the given shortcut folder
+!macro EIT_MUI_SHORTCUTS_DEFINE_ENTRY ENTRY_NAME SHORTCUT_FOLDER
+
+ !ifndef EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+ !if "${ENTRY_NAME}" == "${SHORTCUT_FOLDER}"
+ !define EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+
+ !ifndef EIT_MUI_SHORTCUTS_FOLDER_${ENTRY_NAME}_ENABLED
+ !define EIT_MUI_SHORTCUTS_FOLDER_${ENTRY_NAME}_ENABLED
+
+ Var eit.mui.ShortcutsPage.${ENTRY_NAME}
+ Var eit.mui.ShortcutsPage.${ENTRY_NAME}.State
+
+ !ifndef EIT_MUI_SHORTCUTS_ENABLED
+ !define EIT_MUI_SHORTCUTS_ENABLED
+ !endif
+
+ !endif
+
+ !endif
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTS_DEFINE_ENTRY
+!define EIT_MUI_SHORTCUTS_DefineEntry '!insertmacro EIT_MUI_SHORTCUTS_DEFINE_ENTRY'
+
+
+; -----------------------------------------------------------------------------
+; Add on the Page a shortcut folder
+!macro EIT_MUI_PAGE_SHORTCUTS_ADD_FOLDER SHORTCUT_FOLDER
+
+ !ifdef EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+ !undef EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+ !endif
+
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_DefineEntry ${${SHORTCUT_FOLDER}}
+
+ !ifndef EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+ !error "Shortcut folder '${SHORTCUT_FOLDER}' is unsupported"
+ !else
+ !undef EIT_MUI_SHORTCUTS_ENTRY_DEFINED
+ !endif
+
+!macroend ; EIT_MUI_PAGE_SHORTCUTS_ADD_FOLDER
+!define EIT_MUI_PAGE_SHORTCUTS_AddFolder '!insertmacro EIT_MUI_PAGE_SHORTCUTS_ADD_FOLDER'
+
+
+; -----------------------------------------------------------------------------
+; Page interface settings and variables
+!macro EIT_MUI_SHORTCUTSPAGE_INTERFACE
+
+ !ifndef EIT_MUI_SHORTCUTSPAGE_INTERFACE
+ !define EIT_MUI_SHORTCUTSPAGE_INTERFACE
+
+ Var eit.mui.ShortcutsPage
+ Var eit.mui.ShortcutsPage.Description
+ Var eit.mui.ShortcutsPage.y
+
+ !endif
+
+ !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAPS
+ !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTSPAGE_INTERFACE
+
+
+; -----------------------------------------------------------------------------
+; Set initial state for the given file association entry
+!macro EIT_MUI_SHORTCUTS_INIT_ENTRY ENTRY_NAME
+
+ !ifdef EIT_MUI_SHORTCUTS_FOLDER_${ENTRY_NAME}_ENABLED
+
+ StrCpy $eit.mui.ShortcutsPage.${ENTRY_NAME}.State ${EIT_MUI_SHORTCUT_STATE_ENABLE}
+
+ !endif
+
+!macroend
+!define EIT_MUI_SHORTCUTS_InitEntry '!insertmacro EIT_MUI_SHORTCUTS_INIT_ENTRY'
+
+
+; -----------------------------------------------------------------------------
+; Interface initialization
+!macro EIT_MUI_SHORTCUTSPAGE_GUIINIT
+
+ !ifndef EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}SHORTCUTSPAGE_GUINIT
+ !define EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}SHORTCUTSPAGE_GUINIT
+
+ Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.ShortcutsPage.GUIInit
+
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_InitEntry ""
+
+ !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT
+ Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}"
+ !endif
+
+ FunctionEnd ; eit.mui.ShortcutsPage.GUIInit
+
+ !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}eit.mui.ShortcutsPage.GUIInit
+
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTSPAGE_GUIINIT
+
+
+; -----------------------------------------------------------------------------
+; Page declaration
+!macro EIT_MUI_PAGEDECLARATION_SHORTCUTS ${CREATE_SHORTCUT}
+
+ !insertmacro MUI_SET EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}SHORTCUTSPAGE ""
+ !insertmacro EIT_MUI_SHORTCUTSPAGE_INTERFACE
+
+ !insertmacro EIT_MUI_SHORTCUTSPAGE_GUIINIT
+ !define EIT_MUI_SHORTCUTSPAGE_CREATE_SHORTCUT ${CREATE_SHORTCUT}
+
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_HEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_HEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_SUBHEADER "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_SUBHEADER)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_DESCRIPTION "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_DESCRIPTION)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_DESKTOP "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_TODESKTOP)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_QUICKLAUNCH "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_TOQUICK)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_STARTMENU "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_TOSTARTMENU)"
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUTSPAGE_STARTUP "$(EIT_MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SHORTCUTS_TOSTARTUP)"
+
+ !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW
+
+ PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom
+
+ PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_ShortcutsPage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_ShortcutsPage.Leave_${MUI_UNIQUEID}
+
+ PageExEnd
+
+ !insertmacro EIT_MUI_FUNCTION_SHORTCUTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_ShortcutsPage.Pre_${MUI_UNIQUEID} \
+ ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}EIT_MUI_ShortcutsPage.Leave_${MUI_UNIQUEID}
+
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_HEADER
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_SUBHEADER
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_DESCRIPTION
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_DESKTOP
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_QUICKLAUNCH
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_STARTMENU
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTSPAGE_STARTUP
+
+!macroend ; EIT_MUI_PAGEDECLARATION_SHORTCUTS
+
+
+; -----------------------------------------------------------------------------
+; Parameter 'CREATE_SHORTCUT' is a macro to be used to create Shortcut for
+; the items whitch are selected by the user.
+!macro EIT_MUI_PAGE_SHORTCUTS CREATE_SHORTCUT
+
+ !ifdef EIT_MUI_SHORTCUTS_ENABLED
+ !verbose push
+ !verbose ${MUI_VERBOSE}
+
+ !insertmacro MUI_PAGE_INIT
+ !insertmacro EIT_MUI_PAGEDECLARATION_SHORTCUTS ${CREATE_SHORTCUT}
+
+ !verbose pop
+ !endif
+
+!macroend ; EIT_MUI_PAGE_SHORTCUTS
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_MUI_SHORTCUTS_CREATE_CHECKBOX ENTRY_NAME YPOS
+
+ !ifdef EIT_MUI_SHORTCUTS_FOLDER_${ENTRY_NAME}_ENABLED
+
+ ${NSD_CreateCheckBox} 16u ${YPOS}u 284u 8u "${EIT_MUI_SHORTCUTSPAGE_${ENTRY_NAME}}"
+ Pop $eit.mui.ShortcutsPage.${ENTRY_NAME}
+
+ ${NSD_SetState} $eit.mui.ShortcutsPage.${ENTRY_NAME} \
+ $eit.mui.ShortcutsPage.${ENTRY_NAME}.State
+
+ IntOp ${YPOS} ${YPOS} + 16
+
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTS_CREATE_CHECKBOX
+!define EIT_MUI_SHORTCUTS_CreateCheckbox '!insertmacro EIT_MUI_SHORTCUTS_CREATE_CHECKBOX'
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_MUI_SHORTCUTS_SAVE_CHECKBOX_STATE ENTRY_NAME
+
+ !ifdef EIT_MUI_SHORTCUTS_FOLDER_${ENTRY_NAME}_ENABLED
+
+ ${NSD_GetState} $eit.mui.ShortcutsPage.${ENTRY_NAME} \
+ $eit.mui.ShortcutsPage.${ENTRY_NAME}.State
+
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTS_SAVE_CHECKBOX_STATE
+!define EIT_MUI_SHORTCUTS_SaveCheckboxState '!insertmacro EIT_MUI_SHORTCUTS_SAVE_CHECKBOX_STATE'
+
+
+; -----------------------------------------------------------------------------
+; Page functions
+!macro EIT_MUI_FUNCTION_SHORTCUTSPAGE PRE LEAVE
+
+ ; ---------------------------------------------------------------------------
+ Function "${PRE}"
+
+ !ifndef EIT_MUI_SHORTCUTS_ENABLED
+ Abort
+ !endif
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
+ !insertmacro MUI_HEADER_TEXT_PAGE ${EIT_MUI_SHORTCUTSPAGE_HEADER} \
+ ${EIT_MUI_SHORTCUTSPAGE_SUBHEADER}
+
+ nsDialogs::Create /NOUNLOAD 1018
+ Pop $eit.mui.ShortcutsPage
+
+ ${if} $eit.mui.ShortcutsPage == error
+ Abort
+ ${endif}
+
+ ; Description text
+ ${NSD_CreateLabel} 0u 0u 300u 8u "${EIT_MUI_SHORTCUTSPAGE_DESCRIPTION}"
+ Pop $eit.mui.ShortcutsPage.Description
+
+ ; CheckBoxes
+ StrCpy $eit.mui.ShortcutsPage.y 20
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_CreateCheckbox \
+ $eit.mui.ShortcutsPage.y
+
+ nsDialogs::Show
+
+ FunctionEnd ; PRE
+
+
+ ; ---------------------------------------------------------------------------
+ Function "${LEAVE}"
+
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_SaveCheckboxState ""
+
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE
+
+ FunctionEnd ; LEAVE
+
+!macroend ; EIT_MUI_FUNCTION_SHORTCUTSPAGE
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_MUI_SHORTCUTS_PROCESS_SHORTCUT ENTRY_NAME SHORTCUT_FOLDER
+
+ !if "${ENTRY_NAME}" == "${SHORTCUT_FOLDER}"
+
+ ${if} "$eit.mui.ShortcutsPage.${ENTRY_NAME}.State" == "${EIT_MUI_SHORTCUT_STATE_ENABLE}"
+
+ ${${EIT_MUI_SHORTCUTSPAGE_CREATE_SHORTCUT}} \
+ "${EIT_MUI_SHORTCUT_FOLDER_LOCATION_${ENTRY_NAME}}\${EIT_MUI_SHORTCUTS_LNK_FILE}" \
+ "${EIT_MUI_SHORTCUTS_TARGET_FILE}" \
+ '${${EIT_MUI_SHORTCUTS_PARAMETERS}}' \
+ "${EIT_MUI_SHORTCUTS_WORKING_DIR}"
+
+ ${endif}
+
+ !endif
+
+!macroend ; EIT_MUI_SHORTCUTS_PROCESS_SHORTCUT
+!define EIT_MUI_SHORTCUTS_ProcessShortcut '!insertmacro EIT_MUI_SHORTCUTS_PROCESS_SHORTCUT'
+
+
+; -----------------------------------------------------------------------------
+; Create selected shortcuts.
+!macro EIT_MUI_PAGE_SHORTCUTS_CREATE_SHORTCUT SHORTCUT_FOLDER \
+ LNK_FILE TARGET_FILE PARAMETERS WORKING_DIR
+
+ !ifdef EIT_MUI_SHORTCUTS_ENABLED
+
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUT_FOLDER_LOCATION_DESKTOP $DESKTOP
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUT_FOLDER_LOCATION_QUICKLAUNCH $QUICKLAUNCH
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUT_FOLDER_LOCATION_STARTMENU $STARTMENU
+ !insertmacro MUI_DEFAULT EIT_MUI_SHORTCUT_FOLDER_LOCATION_STARTUP $SMSTARTUP
+
+ !insertmacro MUI_SET EIT_MUI_SHORTCUTS_LNK_FILE "${LNK_FILE}"
+ !insertmacro MUI_SET EIT_MUI_SHORTCUTS_TARGET_FILE "${TARGET_FILE}"
+ !insertmacro MUI_SET EIT_MUI_SHORTCUTS_PARAMETERS PARAMETERS
+ !insertmacro MUI_SET EIT_MUI_SHORTCUTS_WORKING_DIR "${WORKING_DIR}"
+
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_ProcessShortcut ${${SHORTCUT_FOLDER}}
+
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTS_LNK_FILE
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTS_TARGET_FILE
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTS_PARAMETERS
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUTS_WORKING_DIR
+
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUT_FOLDER_LOCATION_DESKTOP
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUT_FOLDER_LOCATION_QUICKLAUNCH
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUT_FOLDER_LOCATION_STARTMENU
+ !insertmacro MUI_UNSET EIT_MUI_SHORTCUT_FOLDER_LOCATION_STARTUP
+
+ !endif
+
+!macroend ; EIT_MUI_PAGE_SHORTCUTS_CREATE_SHORTCUTS
+!define EIT_MUI_PAGE_SHORTCUTS_CreateShortcut '!insertmacro EIT_MUI_PAGE_SHORTCUTS_CREATE_SHORTCUT'
+
+
+; -----------------------------------------------------------------------------
+!macro EIT_MUI_SHORTCUTS_GET_SHORTCUT_INFO ENTRY_NAME OUT_INFO
+
+ ${if} "$eit.mui.ShortcutsPage.${ENTRY_NAME}.State" == "${EIT_MUI_SHORTCUT_STATE_ENABLE}"
+
+ StrCpy ${OUT_INFO} "${OUT_INFO}${EIT_MUI_MSG_INFO_SHORTCUTS_${ENTRY_NAME}}"
+
+ ${endif}
+
+!macroend ; EIT_MUI_SHORTCUTS_GET_SHORTCUT_INFO
+!define EIT_MUI_SHORTCUTS_GetShortcutInfo '!insertmacro EIT_MUI_SHORTCUTS_GET_SHORTCUT_INFO'
+
+
+; -----------------------------------------------------------------------------
+; Out: $R0 = Return information of selected shortcuts.
+!macro EIT_MUI_PAGE_SHORTCUTS_GET_INSTALLINFO
+
+ StrCpy $R0 ""
+ !ifdef EIT_MUI_SHORTCUTS_ENABLED
+
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_INFO_SHORTCUTS_DESKTOP "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_SHORTCUTS_DESKTOP)"
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_INFO_SHORTCUTS_QUICKLAUNCH "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_SHORTCUTS_QUICKLAUNCH)"
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_INFO_SHORTCUTS_STARTMENU "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_SHORTCUTS_STARTMENU)"
+ !insertmacro MUI_DEFAULT EIT_MUI_MSG_INFO_SHORTCUTS_STARTUP "$(${MUI_PAGE_UNINSTALLER_PREFIX}MSG_INFO_SHORTCUTS_STARTUP)"
+
+ ${EIT_MUI_SHORTCUTS_IterateEntries} EIT_MUI_SHORTCUTS_GetShortcutInfo $R0
+
+ !insertmacro MUI_UNSET EIT_MUI_MSG_INFO_SHORTCUTS_DESKTOP
+ !insertmacro MUI_UNSET EIT_MUI_MSG_INFO_SHORTCUTS_QUICKLAUNCH
+ !insertmacro MUI_UNSET EIT_MUI_MSG_INFO_SHORTCUTS_STARTMENU
+ !insertmacro MUI_UNSET EIT_MUI_MSG_INFO_SHORTCUTS_STARTUP
+
+ !endif
+
+!macroend ; EIT_MUI_PAGE_SHORTCUTS_GET_INSTALLINFO
+!define EIT_MUI_PAGE_SHORTCUTS_GetInstallInfo '!insertmacro EIT_MUI_PAGE_SHORTCUTS_GET_INSTALLINFO'
diff --git a/trunk/NSIS/resources/license.txt b/trunk/NSIS/resources/license.txt
new file mode 100644
index 0000000..14a959c
--- /dev/null
+++ b/trunk/NSIS/resources/license.txt
@@ -0,0 +1,17 @@
+Copyright (C) 2011-2012 by Gillen Daniel and licensed under GPLv3.
+
+This program uses Richard W.M. Jones's hivex library
+
+Copyright (C) 2009-2010 Red Hat Inc.
+Derived from code by Petter Nordahl-Hagen under a compatible license:
+Copyright (C) 1997-2007 Petter Nordahl-Hagen.
+Derived from code by Markus Stephany under a compatible license:
+Copyright (C) 2000-2004 Markus Stephany.
+
+This program uses a modified version of the QHexEdit widget by Simon Winfried
+
+Copyright (c) 2010 by Simon Winfried
+
+This program uses Qt
+
+Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
\ No newline at end of file
diff --git a/trunk/NSIS/resources/xinst_header.bmp b/trunk/NSIS/resources/xinst_header.bmp
new file mode 100644
index 0000000..941af82
Binary files /dev/null and b/trunk/NSIS/resources/xinst_header.bmp differ
diff --git a/trunk/NSIS/resources/xinst_page.bmp b/trunk/NSIS/resources/xinst_page.bmp
new file mode 100644
index 0000000..292b813
Binary files /dev/null and b/trunk/NSIS/resources/xinst_page.bmp differ
diff --git a/trunk/NSIS/resources/xuninst.ico b/trunk/NSIS/resources/xuninst.ico
new file mode 100644
index 0000000..94db1b2
Binary files /dev/null and b/trunk/NSIS/resources/xuninst.ico differ
diff --git a/trunk/NSIS/resources/xuninst_page.bmp b/trunk/NSIS/resources/xuninst_page.bmp
new file mode 100644
index 0000000..1d544e3
Binary files /dev/null and b/trunk/NSIS/resources/xuninst_page.bmp differ
diff --git a/trunk/hivex/Makefile.am b/trunk/hivex/Makefile.am
index 8d69c55..138765d 100644
--- a/trunk/hivex/Makefile.am
+++ b/trunk/hivex/Makefile.am
@@ -1,65 +1,65 @@
# hivex
# Copyright (C) 2009-2011 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
ACLOCAL_AMFLAGS = -I m4
# Work around broken libtool.
export to_tool_file_cmd=func_convert_file_noop
-SUBDIRS = gnulib/lib generator lib images gnulib/tests sh xml po
+SUBDIRS = gnulib/lib generator lib images gnulib/tests po
if HAVE_OCAML
SUBDIRS += ocaml
endif
if HAVE_PERL
SUBDIRS += perl regedit
endif
if HAVE_PYTHON
SUBDIRS += python
endif
if HAVE_RUBY
SUBDIRS += ruby
endif
EXTRA_DIST = hivex.pc hivex.pc.in README LICENSE
# Generate the ChangeLog automatically from the gitlog.
dist-hook:
$(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
cp ChangeLog $(distdir)/ChangeLog
# Pkgconfig.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = hivex.pc
# Maintainer website update.
HTMLFILES = \
html/hivex.3.html \
html/hivexget.1.html \
html/hivexml.1.html \
html/hivexregedit.1.html \
html/hivexsh.1.html
WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
website: $(HTMLFILES)
cp $(HTMLFILES) $(WEBSITEDIR)
CLEANFILES = $(HTMLFILES) pod2*.tmp
diff --git a/trunk/makehivex.sh b/trunk/makehivex.sh
index 158c76a..b69bf01 100755
--- a/trunk/makehivex.sh
+++ b/trunk/makehivex.sh
@@ -1,13 +1,14 @@
#!/bin/bash
# When compiling under mingw, make sure PKG_CONFIG_PATH is set
uname | grep MINGW &>/dev/null
if [ $? -eq 0 ]; then
export PKG_CONFUG_PATH="/local/lib/pkgconfig"
fi
cd hivex
make clean
+autoreconf
./configure --disable-ocaml --disable-perl --disable-python --disable-ruby && make
cd ..

File Metadata

Mime Type
text/x-diff
Expires
Sat, Nov 23, 3:53 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1162327
Default Alt Text
(79 KB)

Event Timeline