【Inno Setup】Gif插件1.0

来源:互联网 发布:床垫怎么选 知乎 编辑:程序博客网 时间:2024/06/04 18:11

GifLib.iss

[Files]Source: compiler:GifLib.dll; DestDir: {tmp}; Flags: dontcopy noencryption[Code]//初始化创建Gif图像组件于父句柄function GifInit(HWD: HWND):Integer;external 'GifInit@files:GifLib.dll stdcall';//设置Gif图像组件大小与位置Procedure GifSetBounds(Handle, Left, Top, Width, Height: Integer);external 'GifSetBounds@files:GifLib.dll stdcall';//设置Gif图像组件图片文件Procedure GifSetFile(Handle: Integer; FileName: AnsiString);external 'GifSetFile@files:GifLib.dll stdcall';//设置Gif图像组件父句柄Procedure GifSetParentWindow(Handle: Integer; HWND: HWND);external 'GifSetParentWindow@files:GifLib.dll stdcall';//释放指定句柄的Gif图像组件Procedure GifFree(Handle: Integer);external 'GifFree@files:GifLib.dll stdcall';//释放全部Gif图像组件Procedure GifAllFree;external 'GifAllFree@files:GifLib.dll stdcall';

GifLib_Example.iss

; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!#include "compiler:GifLib.iss"[Setup]; 注: AppId的值为单独标识该应用程序。; 不要为其他安装程序使用相同的AppId值。; (生成新的GUID,点击 工具|在IDE中生成GUID。)AppId={{A18A3B64-E516-4299-A51A-5A48BF64E94D}AppName=我的程序AppVerName=我的程序 1.5AppPublisher=我的公司AppPublisherURL=http://www.example.com/AppSupportURL=http://www.example.com/AppUpdatesURL=http://www.example.com/DefaultDirName={pf}\我的程序DefaultGroupName=我的程序WizardImageStretch=falseOutputDir=userdocs:Inno Setup Examples OutputOutputBaseFilename=setupCompression=lzmaSolidCompression=no[Tasks]Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked[Files]Source: compiler:Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversionSource: compiler:Examples\1139681544755.gif; DestDir: {tmp}; Flags: dontcopy   noencryption[Code]var  GifHandle:Integer;procedure InitializeWizard();varF: String;begin  F:= ExpandConstant('{tmp}\1139681544755.gif');  ExtractTemporaryFile('1139681544755.gif');  GifHandle := GifInit(WizardForm.WelcomePage.Handle);  GifSetBounds(GifHandle, WizardForm.WizardBitmapImage.Left, WizardForm.WizardBitmapImage.Top, WizardForm.WizardBitmapImage.Width ,WizardForm.WizardBitmapImage.Height);  GifSetFile(GifHandle, F);     DeleteFile(F);end;procedure CurPageChanged(CurPageID: Integer);begin  Case CurPageID of    wpWelcome : GifSetParentWindow(GifHandle, WizardForm.WelcomePage.Handle);    wpFinished: GifSetParentWindow(GifHandle, WizardForm.FinishedPage.Handle);  end;end;procedure DeinitializeSetup();begin  GifAllFree;end;


0 0