sjwrec [more=Первый Скрипт]; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "Калькулятор калорий HiKi"
#define MyAppVersion "2.25"
#define MyAppPublisher "Copyright © 2013 HiKi-Soft"
#define MyAppURL "http://hiki-soft.ru/"
#define MyAppExeName "shud.exe"
#include "WinTB.iss"
#include "botva2.iss"
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=true
OutputBaseFilename={#MyAppName} {#MyAppVersion} RePack by Xabib
SetupIconFile=ico.ico
Compression=lzma/Ultra64
SolidCompression=true
InternalCompressLevel=Ultra64
DiskSpanning=false
DiskSliceSize=736000000
ShowLanguageDialog=yes
SlicesPerDisk=4
UninstallDisplayIcon={app}\ico.ico
;Производитель.
AppPublisher={#MyAppPublisher}
RawDataResource=Botva:botva2.dll|b2p:b2p.dll|Logo:logo.png|bPic:bPic.png|LiPic:LiPic.png|aPic:aPic.png
AppModifyPath={app}
VersionInfoProductName={#MyAppName}
DirExistsWarning=no
AppendDefaultDirName=false
AppendDefaultGroupName=false
DisableReadyPage=true
AppID=HiKi-Soft
VersionInfoDescription={#MyAppName} RePack by Xabib
AppCopyright=Xabib © 2013
VersionInfoVersion={#MyAppVersion}
VersionInfoProductVersion={#MyAppVersion}
VersionInfoCopyright=Xabib © 2013
DisableFinishedPage=false
UninstallDisplayName={#MyAppName}
DisableProgramGroupPage=true
ComponentsListTVStyle=true
[Languages]
Name: "Russian"; MessagesFile: "Russian.isl"
[CustomMessages]
Russian.Msg1=Перед установкой необходимо удалить предыдущую версию приложения. Продолжить?
Russian.MsgErorr=Удаление завершилось неудачей!
[Types]
Name: full; Description: Полная установка; Flags: iscustom
[Components]
Name: icons; Description: {cm:AdditionalIcons}; Types: full;
Name: icons\desktop; Description: {cm:CreateDesktopIcon}; Types: full;
Name: icons\quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; OnlyBelowVersion: 0,6.1; Types: full;
Name: icons\quicklaunchicon7; Description: {cm:CreateQuickLaunchIcon}; MinVersion: 0,6.1; Types: full;
Name: InterfaceLang; Description: {cm:InterfaceLang}; Flags: fixed; Types: full;
Name: InterfaceLang\en; Description: Английский; Flags: exclusive;
Name: InterfaceLang\ru; Description: Русский; Flags: exclusive;
[Files]
;Файлы распаковываемые в папку с игрой. Необходимы для деинсталлятора;
Source: WinTB.dll; Flags: dontcopy;
Source: ico.ico; DestDir: {app}; Flags: ignoreversion
Source: PinToTasckbar.vbs; DestDir: {tmp}; Flags: deleteafterinstall
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
Source: {app}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs;
[Registry]
Root: HKCU; SubKey: Software\HiKi-Soft; Flags: uninsdeletekeyifempty
Root: HKCU; SubKey: Software\HiKi-Soft\HiKi KK; ValueType: string; ValueName: install; ValueData: {app}; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKCU; SubKey: Software\HiKi-Soft\HiKi KK; ValueType: string; ValueName: upd; ValueData: 1; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKCU; SubKey: "Software\HiKi-Soft\HiKi KK"; ValueType: dword; ValueName: language; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty; Components: InterfaceLang\ru;
Root: HKCU; SubKey: "Software\HiKi-Soft\HiKi KK"; ValueType: dword; ValueName: language; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty; Components: InterfaceLang\en;
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName};
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe};
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL};
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName};
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName};
[Run]
Filename: {app}\{#MyAppExeName}; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait skipifsilent PostInstall;
Filename: {tmp}\PinToTasckbar.vbs; Parameters: """{app}\{#MyAppExeName}"""; Flags: shellexec;
[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
///////////////////////////////////Относится к лого и изображениям мастера
RT_RCDATA = 10;
function UninstallMyApp(): Boolean;
var
Buff: String;
i: Integer;
begin
Result := not RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1', 'UninstallString', Buff );
if not Result then Result := not FileExists(RemoveQuotes(Buff));
if not Result then if MsgBox(CustomMessage('Msg1'), mbError, MB_YESNO) = IDYES then
try
Exec(RemoveQuotes(Buff), '', ExtractFilePath(RemoveQuotes(Buff)), SW_SHOW, ewWaitUntilTerminated, i);
finally
Result := not RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1', 'UninstallString', Buff );
if not Result then MsgBox(CustomMessage('MsgErorr'), mbError, MB_OK);
end;
end;
var
///////////////////////////////////Лого и изображения
lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
BtnImage: TBitmapImage;
///////////////////////////////////////////
CheckLicense: TCheckBox;
iInitialize: Boolean;
///////////////////////////////////Ресурсы(относится к лого и изображениям мастера)
function GetFromRes(const ResName, SaveFileName: String): Boolean;
var
lResStream: TResourceStream;
begin
lResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
try
lResStream.SaveToFile(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
finally
lResStream.Free;
Result := FileExists(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
end;
end;
function InitializeSetup:boolean;
begin
Result := UninstallMyApp();
end;
procedure InitializeWizard;
begin
WizardForm.DiskSpaceLabel.Top := ScaleY(65);
WizardForm.DirBrowseButton.Top := ScaleY(36);
WizardForm.DirEdit.Top := ScaleY(37);
WizardForm.NoIconsCheck.Parent := WizardForm.SelectDirPage;
WizardForm.SelectDirLabel.Top := ScaleX(09)
WizardForm.SelectDirBitmapImage.Top := ScaleY(0)
WizardForm.SelectDirBrowseLabel.Visible := False
WizardForm.SelectGroupBitmapImage.Top := ScaleY(95);
WizardForm.SelectGroupBitmapImage.Parent := WizardForm.SelectDirPage;
WizardForm.GroupBrowseButton.Parent := WizardForm.SelectDirPage;
WizardForm.GroupBrowseButton.Top := ScaleY(133);
WizardForm.GroupEdit.Parent := WizardForm.SelectDirPage;
WizardForm.GroupEdit.Top := ScaleY(134);
WizardForm.SelectStartMenuFolderBrowseLabel.Parent := WizardForm.SelectDirPage;
WizardForm.SelectStartMenuFolderBrowseLabel.Top := ScaleY(170);
WizardForm.SelectStartMenuFolderLabel.Parent := WizardForm.SelectDirPage;
WizardForm.SelectStartMenuFolderLabel.Top := ScaleY(105);
with WizardForm do
begin
///////////////////////////////////Логотип и изображения мастера
iInitialize := True;
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_BPIC', 'bPic.png') and GetFromRes('_IS_LIPIC', 'LiPic.png') and GetFromRes('_IS_APIC', 'aPic.png') then
begin
///////////////////////////////////Изображения
bPicHandle := ImgLoad(WelcomePage.Handle, ExpandConstant('{tmp}\aPic.png'), WizardBitmapImage.Left, WizardBitmapImage.Top, WizardBitmapImage.Width, WizardBitmapImage.Height, True, True);
WizardBitmapImage.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(WelcomePage.Handle);
bPicHandle := ImgLoad(FinishedPage.Handle, ExpandConstant('{tmp}\bPic.png'), WizardBitmapImage2.Left, WizardBitmapImage2.Top, WizardBitmapImage2.Width, WizardBitmapImage2.Height, True, True);
WizardBitmapImage2.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(FinishedPage.Handle);
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
////////////////////////////////////////////
///////////////////////////////////Логотип
lPLogo:= ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40), True, True);
ImgApplyChanges(WizardForm.Handle);
end;
///////////////////////////////////WinTB
ExtractTemporaryFile('WinTB.dll');
SetTaskBarProgressValue(0, 60);
SetTaskBarProgressState(0, TBPF_ERROR);
TaskBarV10(MainForm.Handle, WizardForm.Handle, false, false, 0, 0, _m_);
//////////////////////////////////////
with TLabel.Create(WizardForm) do
begin
Parent:=WizardForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40));
end;
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
------------------------
wpSelectComponents:
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
end;
end;
procedure DeinitializeSetup();
begin
if iInitialize then
begin
gdipShutdown;
TaskBarDestroy;
end;
end;
procedure InitializeUninstallProgressForm;
begin
with UninstallProgressForm do
begin
///////////////////////////////////Логотип и изображения мастера
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_LIPIC', 'LIPic.png') then
begin
///////////////////////////////////Изображения
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
///////////////////////////////////Логотип
lPLogo:= ImgLoad(UninstallProgressForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40), True, True);
ImgApplyChanges(UninstallProgressForm.Handle);
end;
with TLabel.Create(nil) do
begin
Parent:=UninstallProgressForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40));
end;
end;
end;
procedure DeinitializeUninstall();
begin
gdipShutdown;
end;
[/more]
Второй скрипт