我用Innosetup创建的exe被视为病毒!
它真的很烦人,因为我无法发送它们来帮助我的用户.
谁有人遇到过这个问题?
我使用InnoSetup 5.5,我实际上并没有复制文件,我只需生成一些命令来处理证书.
提前致谢
[编辑]
Inno剧本
所以它有点复杂,因为我需要使用psexec使管理员权限,删除以前的证书,然后安装新的
#define MyAppname "Update Certificate"#define MyAppVersion "1.0" #define MyAppPublisher "kkk"#define MyAppExename "updateBase"#define installConf "installConfig.exe" #define uninstallCert "unCert.exe"#define psexec "psexec.exe"#define passadmin "password"[Setup]Appname={#MyAppname}AppVersion={#MyAppVersion}AppPublisher={#MyAppPublisher}DefaultDirname={localappdata}DisabledirPage=yesdisableReadyPage=yesdisableWelcomePage=yesPrivilegesrequired=noneCreateAppDir=no CreateUninstallregKey = no OutputBasefilename={#MyAppExename}Compression=lzmaSolIDCompression=yes SetupIconfile=favicon.ico[Languages]name: "english"; Messagesfile: "compiler:Default.isl"[files]Source: "{#installConf}"; Flags: dontcopySource: "{#psexec}"; Flags: dontcopySource: "{#uninstallCert}"; Flags: dontcopy[Code]var ResultCode: Integer; Page: TWizardPage; CustomPageID: Integer; installradiobutton: TNewRadiobutton; Deleteradiobutton: TNewRadiobutton; Updateradiobutton: TNewRadiobutton;procedure ExitProcess(exitCode:integer); external 'ExitProcess@kernel32.dll stdcall';
unCert.exe正在取消证书以删除它们
// Uninstall prevIoUs certificate function UninstallCertificat(): Boolean;var arg: String;begin ExtractTemporaryfile('{#uninstallCert}'); ExtractTemporaryfile('{#psexec}'); arg := ' /accepteula -u administrateur -p {#passadmin} -i ' + AddQuotes(ExpandConstant('{tmp}\{#uninstallCert}')) ; Result := Exec(AddQuotes(ExpandConstant('{tmp}\{#psexec}')),arg,'',SW_SHOW,ewWaitUntilTerminated,ResultCode); Log(AddQuotes(ExpandConstant('{tmp}\{#psexec}'))); Log(AddQuotes(ExpandConstant('{tmp}\{#uninstallCert}'))); if ResultCode <> 0 then begin MsgBox('InitializeSetup:' #13#13 'Certificat Uninstall Failed',mbError,MB_OK); ExitProcess(2); end else begin; MsgBox('InitializeSetup:' #13#13 'Certificat Uninstall Done',mbinformation,MB_OK); end; end; // Géneration des Mots de passe pour le certificatsfunction getpassWord(): string;var computername: string; V: string;begin // Something to generate the passwordend;// Certificate installation function InstallCertificat(): Boolean;var arg: String; filename: string; pass: string;begin pass := getpassWord();; ExtractTemporaryfile('{#psexec}'); filename := ExpandConstant('{tmp}\cert.p12'); filecopy(ExpandConstant('{src}\cert.p12'),ExpandConstant('{tmp}\cert.p12'),False); arg := ' /accepteula -u administrateur -p {#passadmin} -i ' + GetSystemDir() +'\certutil.exe -p ' + pass + ' -importPFX ' + filename + ' NoExport'; Result := Exec(AddQuotes(ExpandConstant('{tmp}\{#psexec}')),ResultCode); if ResultCode <> 0 then begin Log( SysErrorMessage(ResultCode)); MsgBox('InitializeSetup:' #13#13 'Certificat Installation Failed',MB_OK); ExitProcess(2); end else begin; MsgBox('InitializeSetup:' #13#13 'Certificat Installation Done',MB_OK); end; end;解决方法 尝试注释掉“SetupIconfile”行.在我的情况下,防病毒的问题在于.ico文件. 总结
以上是内存溢出为你收集整理的inno setup可执行文件被视为病毒全部内容,希望文章能够帮你解决inno setup可执行文件被视为病毒所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)