#include <file.au3>
#include <array.au3>
$distrib = @ScriptDir ; папка с дистрибутивом программы
$install = @ProgramFilesDir ; папка куда прога должна инсталлироватся
If Not @Compiled Then
$struct = _TempFile ()
RunWait (@ComSpec&' /u /c dir /a:-d /b /s "'&$distrib&'\*.*" > "'&$struct&'"', '', @SW_HIDE)
$open_struct = FileOpen ($struct, 32)
$write_install = 0
Do
$write_install += 1
Until FileReadLine (@ScriptFullPath, $write_install) = '; ---=== Begin Install ===---'
$write_install += 1
$i = 1
Do
$input_file = FileReadLine ($open_struct, $i)
If Not @error Then
$output_file = StringReplace($input_file, $distrib, '')
Switch FileReadLine (@ScriptFullPath, $write_install)
Case ''
_FileWriteToLine (@ScriptFullPath, $write_install, "FileInstall ('"&$input_file&"', $install & '"&$output_file&"')", 1)
Case Else
_FileWriteToLine (@ScriptFullPath, $write_install, "FileInstall ('"&$input_file&"', $install & '"&$output_file&"')", 0)
EndSwitch
$write_install += 1
$i += 1
EndIf
Until @error
FileClose ($open_struct)
FileDelete ($open_struct)
EndIf
; ---=== Begin Install ===---
; дальше остальной скрипт