• innosetup完整脚本


    #define MyAppName "Somarto"
    #define MyAppVersion "1.0.0"
    #define MyAppPublisher "XXXXXX有限公司"
    #define MyAppURL "http://www.XXX.cn/"
    #define MyAppExeName "Somarto.exe"
    #define MyAppRegUninstall "SoftwareMicrosoftWindowsCurrentVersionUninstall"
    [Setup]
    AppId={{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}
    AppName={#MyAppName}{#MyAppVersion}
    AppVerName={#MyAppName}{#MyAppVersion}
    AppPublisher={#MyAppPublisher}
    AppPublisherURL={#MyAppURL}
    AppSupportURL={#MyAppURL}
    AppUpdatesURL={#MyAppURL}
    DefaultDirName={pf}Somarto
    VersionInfoCopyright=Copyright @ 2011 -2018 XXX. All Rights Reserved
    DefaultGroupName={#MyAppName}
    OutputDir=D:CKMSomartosetup
    OutputBaseFilename=Somarto-64
    SetupIconFile=D:CKMSomartostyledns32.ico
    Compression=lzma
    SolidCompression=yes
    ArchitecturesAllowed=x64
    ArchitecturesInstallIn64BitMode=x64
    [Languages]
    ;Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" ;Name: "english"; MessagesFile: "compiler:LanguagesEnglish.isl"
    Name: "englishsimp"; MessagesFile: "compiler:Default.isl"
    [Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone;
    Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone

    [Files]
    Source: "D:CKMSomartoinDebugSomarto.exe"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugSomartoGame.exe"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugCoding4Fun.Kinect.WinForm.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugCoding4Fun.Kinect.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugFleck.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugFluorineFx.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugFx.config"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugSomarto.exe.config"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugKinect.Services.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugKinect.Toolbox.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebuglog4net.config"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebuglog4net.dll"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartoinDebugsys.ini"; DestDir: "{app}"; Flags: ignoreversion
    Source: "D:CKMSomartostyle*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ;Source: "*.*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs; BeforeInstall: ChangeDisplay
    ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

    [Icons]
    Name: "{group}{#MyAppName}"; Filename: "{app}{#MyAppExeName}"
    Name: "{group}{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
    Name: "{commondesktop}{#MyAppName}"; Filename: "{app}{#MyAppExeName}"; Tasks: desktopicon

    [Registry]
    Root: HKLM; Subkey: "softwareMicrosoftWindowsCurrentVersionRun"; ValueType: string; ValueName: "Somarto"; ValueData: "{app}Somarto.exe"; Flags: uninsdeletevalue
    ;Root: HKLM; Subkey: "softwareSomarto"; ValueType: string; ValueName: "Install"; ValueData: "{app}"; Flags: uninsdeletevalue Root: HKLM; Subkey: "SoftwareMicrosoftWindowsCurrentVersionUninstall{#MyAppName}"; ValueType:string;ValueName:"UninstallString";ValueData:"{app}unins000.exe" ; Flags:uninsdeletekey
    [Code]
    var
    hasRun:HWND;
    resultCode: Integer;
    resultStr:String;
    function InitializeSetup(): Boolean;
    begin
    Result := True;
    begin
    if RegKeyExists(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1') then
    begin
    if MsgBox('安装程序检测到【Somarto】的一个版本已安装。'#13#10'选择“是”将覆盖安装。'#13#10'选择“否”退出安装程序,放弃安装。', mbConfirmation, MB_YESNO) = IDYES then
    begin
    hasRun := FindWindowByWindowName('Somarto');
    while (hasRun <> 0) do
    begin
    MsgBox('【Somarto】的一个版本正在运行,'#13#10'应用程序将自动退出。',mbConfirmation, MB_OK);
    PostMessage(hasRun,18,0,0);
    Sleep(3);
    hasRun :=0;
    end;
    Result := True;
    end else
    begin
    Result := False;
    exit;
    end;
    end;
    end;

    begin
    if RegQueryStringValue(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1', 'UninstallString', ResultStr) then
    begin
    ResultStr := RemoveQuotes(ResultStr);
    Exec(resultStr, '/VERYSILENT', '', SW_HIDE, ewWaitUntilTerminated, resultCode);
    end;
    end;

    end;


    procedure InitializeWizard();
    begin
    begin
    WizardForm.WizardSmallBitmapImage.Top := ScaleY(0);
    WizardForm.WizardSmallBitmapImage.Left := ScaleX(0);
    WizardForm.WizardSmallBitmapImage.Width := WizardForm.MainPanel.Width;
    WizardForm.WizardSmallBitmapImage.Height := WizardForm.MainPanel.Height;
    WizardForm.PageNameLabel.=40; //设置标题文字显示的大小
    WizardForm.PageDescriptionLabel.= 230; //设置标题文字显示的大小

    end;
    end;


    function InitializeUninstall(): Boolean;
    begin
    begin
    hasRun := FindWindowByWindowName('Somarto');
    if hasRun<>0 then
    begin
    MsgBox('【Somarto】应用程序正在运行。' #13#10 '请先退出您的应用程序,然后再进行卸载。', mbInformation, MB_OK);
    Result := false;
    exit;
    end;
    end;
    begin
    DelTree(ExpandConstant('{app}'), True, True, True);
    RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Softwareicc');
    end;
    Result := true;
    end;

    [Run]
    Filename: "{app}{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

  • 相关阅读:
    CSS3---用户界面
    CSS3---媒体查询与响应式布局
    HDU 5285 wyh2000 and pupil
    POJ 2488 A Knight's Journey
    POJ 1067 取石子游戏
    POJ 2777 Count Color
    POJ 3259 Wormholes
    Project Euler 26 Reciprocal cycles
    POJ 2104 K-th Number
    POJ 1013 Counterfeit Dollar
  • 原文地址:https://www.cnblogs.com/fx2008/p/5042418.html
Copyright © 2020-2023  润新知