#region - 7Zip install script - (Nullsoft)
#include <Common_Functions.au3>
Opt('TrayIconDebug', 1)
Break(False)

; Installer.
$executable = '7Zip 4.42.exe'
; Default group folder in startmenu.
$group = '7-Zip'
; Installation folder in Program Files.
$directory = '7-Zip'

; Run the installer.
$pid = _Nullsoft()
ProcessWaitClose($pid)

; Remove shortcuts.
If _Programs('7-Zip File Manager.lnk') Then
    FileMove($group & '\7-Zip File Manager.lnk', 'Compilers\', 9)
    DirRemove($group, 1)
EndIf

; Unregister the shell extension.
If FileChangeDir(@ProgramFilesDir & '\' & $directory) Then
    If FileExists('7-zip.dll') Then
        RunWait('RegSvr32 /u /s 7-zip.dll')
    EndIf
    ; Remove extra languages
    FileDelete('Lang\*.txt')
EndIf

Exit
#endregion