PDA

Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 8]


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 [44] 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126

vadjliss
07-08-2015, 13:41
парни помогите с этим скриптом
мне нужно что бы было только портативная распаковка
http://piccash.net/allimage/2015/8-7/img_thumb/463982-thumb.png (http://piccash.net/27967/463982/)

[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=.
Uninstallable=IsChecked
CreateUninstallRegKey=IsChecked

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl;

[Tasks]
; Дополнительно
; Ярлык(и) на «Рабочем столе»
Name: "desktopicon"; Description: "Ярлык(и) на «Рабочем столе»"; GroupDescription: "Дополнительно:"; Check: IsChecked
; Ярлыки в меню «Пуск»
Name: "starticon"; Description: "Ярлыки в меню «Пуск»"; GroupDescription: "Дополнительно:"; Check: IsChecked

[Icons]
Name: "{group}\My Program"; Filename: "{uninstallexe}"; Tasks: starticon; Check: not IsChecked
Name: "{commondesktop}\My Program"; Filename: "{uninstallexe}"; Tasks: desktopicon; Check: IsChecked

[Files]
//папка портабл
Source: "C:\Users\Desktop\Output\InstallFiles\*"; DestDir: "{app}"; Check: "not IsChecked"; Flags: ignoreversion createallsubdirs recursesubdirs
Source: "C:\Users\Desktop\Output\InstallFiles\*"; DestDir: "{app}"; Check: "IsChecked"; Flags: ignoreversion createallsubdirs recursesubdirs
; Файлы для проверки и демонстрации. При реальном использовании - закомментировать или удалить!
;Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs


[CustomMessages]
HeaderLabelPage=Выбор типа установки
LabelPage=Выберите нужный тип установки
MyRadioCaption_1=Распаковка
MyRadioCaption_2=Обычная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Будет произведена распаковка в паку,%nуказанную на следующей странице
MyText_2=Будет произведена стандартная установка
Extracted=Распаковка — %1
ExtractedFolder=Выбор папки распаковки
ExtractedFolder2=В какую папку вы хотите распаковать %1?
ExtractedFolder3=Программа распакует %1 в следующую папку.
ExtractedFolder4=Программа установит %1 в следующую папку.
Installing=Распаковка...
InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер.
FinishedHeadingLabel=Завершение распаковки%n%1
FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки.

[UninstallDelete]
Type: filesandordirs; Name: {app}

[code]
const
DI_NORMAL = 3;

var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall';

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

try
// в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа.
// Можно использовать обычные .ico
AIconFileName:= ExpandConstant('{sys}\shell32.dll');
//

Rect.Left:= 0;
Rect.Top:= 0;
Rect.Right:= 32;
Rect.Bottom:= 32;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(68);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(138);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(120);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(138);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
if IsChecked then
WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else
WizardForm.DirEdit.Text := ExpandConstant( '{src}\{#SetupSetting("AppName")}' );
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;

us_ov
07-08-2015, 15:44
знающие подскажите где правятся надписи в форме выбора папок
например: Если вы хотите выбрать другую папку, нажмите "Обзор"

vadjliss
07-08-2015, 20:26
парни помогите с этим скриптом
мне нужно что бы было только портативная распаковка
const
DI_NORMAL = 3;

var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall';

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

try
// в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа.
// Можно использовать обычные .ico
AIconFileName:= ExpandConstant('{sys}\shell32.dll');
//

Rect.Left:= 0;
Rect.Top:= 0;
Rect.Right:= 32;
Rect.Bottom:= 32;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(68);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(138);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(120);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(138);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
if IsChecked then
WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else
WizardForm.DirEdit.Text := ExpandConstant( '{src}\{#SetupSetting("AppName")}' );
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;

ROMKA-1977
07-08-2015, 21:42
Помогите пож. как исправить ошибку.
Код для добавления / удаления программ из правил брандмауэра Windows:

[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
OutputDir=.

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Icons]
Name: {group}\{cm:UninstallProgram,My Program}; Filename: {uninstallexe}

[code]
// Вспомогательные функции для установки Inno
// Используется для добавления / удаления программ из правил брандмауэра Windows
// Код, родом из http://news.jrsoftware.org/news/innosetup/msg43799.html

const
NET_FW_SCOPE_ALL = 0;
NET_FW_IP_VERSION_ANY = 2;

procedure SetFirewallException(AppName,FileName:string);
var
FirewallObject: Variant;
FirewallManager: Variant;
FirewallProfile: Variant;
begin
try
FirewallObject := CreateOleObject('HNetCfg.FwAuthorizedApplication');
FirewallObject.ProcessImageFileName := FileName;
FirewallObject.Name := AppName;
FirewallObject.Scope := NET_FW_SCOPE_ALL;
FirewallObject.IpVersion := NET_FW_IP_VERSION_ANY;
FirewallObject.Enabled := True;
FirewallManager := CreateOleObject('HNetCfg.FwMgr');
FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile;
FirewallProfile.AuthorizedApplications.Add(FirewallObject);
except
end;
end;

procedure RemoveFirewallException( FileName:string );
var
FirewallManager: Variant;
FirewallProfile: Variant;
begin
try
FirewallManager := CreateOleObject('HNetCfg.FwMgr');
FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile;
FireWallProfile.AuthorizedApplications.Remove(FileName);
except
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssPostInstall then
SetFirewallException('My Server', ExpandConstant('{app}')+'\TCPServer.exe');
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usPostUninstall then
RemoveFirewallException(ExpandConstant('{app}')+'\TCPServer.exe');
end;

Компилируется норм но при установке вылетает ошибка:
http://rghost.ru/8sbhcHrMW/image.png

Компилирую стандартным Ansi

Nordek
07-08-2015, 22:19
мне нужно что бы было только портативная распаковка »Если вам нужно использовать инсталлятор только для распаковки, то зачем вам код?
В [Setup] добавьте
Uninstallable=false



Если вы хотите выбрать другую папку, нажмите "Обзор" »
Вариант 1:
[Messages]
ButtonWizardBrowse=Кнопка &обзор...

Вариант 2:
[CustomMessages]
BrowseButton1=Обзор 1
BrowseButton2=Обзор 2

[Code]
procedure InitializeWizard();
begin
WizardForm.DirBrowseButton.Caption := ExpandConstant('{cm:BrowseButton1}');
WizardForm.GroupBrowseButton.Caption := ExpandConstant('{cm:BrowseButton2}');
end;

TryRooM
07-08-2015, 23:20
ROMKA-1977, Пробуйте. Проверял на Ansi - Unicode, от Restools

const
NET_FW_SCOPE_ALL = 0;
NET_FW_IP_VERSION_ANY = 2;
NET_FW_ACTION_ALLOW = 1;

procedure SetFirewallExceptionXP(AppName,FileName:string);
var
FirewallObject: Variant;
FirewallManager: Variant;
FirewallProfile: Variant;
begin
try
FirewallObject := CreateOleObject('HNetCfg.FwAuthorizedApplication');
FirewallObject.ProcessImageFileName := FileName;
FirewallObject.Name := AppName;
FirewallObject.Scope := NET_FW_SCOPE_ALL;
FirewallObject.IpVersion := NET_FW_IP_VERSION_ANY;
FirewallObject.Enabled := True;
FirewallManager := CreateOleObject('HNetCfg.FwMgr');
FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile;
FirewallProfile.AuthorizedApplications.Add(FirewallObject);
except
end;
end;

procedure SetFirewallExceptionVista(AppName,FileName:string);
var
firewallRule: Variant;
firewallPolicy: Variant;
begin
try
firewallRule := CreateOleObject('HNetCfg.FWRule');
firewallRule.Action := NET_FW_ACTION_ALLOW;
firewallRule.Description := AppName;
firewallRule.ApplicationName := FileName;
firewallRule.Enabled := True;
firewallRule.InterfaceTypes := 'All';
firewallRule.Name := AppName;

firewallPolicy := CreateOleObject('HNetCfg.FwPolicy2');
firewallPolicy.Rules.Add(firewallRule);
except
end;
end;

procedure SetFirewallException(AppName,FileName:string);
var
WindVer: TWindowsVersion;
begin
try
GetWindowsVersionEx(WindVer);
if WindVer.NTPlatform and (WindVer.Major >= 6) then
SetFirewallExceptionVista(AppName,FileName)
else
SetFirewallExceptionXP(AppName,FileName);
except
end;
end;

procedure RemoveFirewallException( FileName:string );
var
FirewallManager: Variant;
FirewallProfile: Variant;
begin
try
FirewallManager := CreateOleObject('HNetCfg.FwMgr');
FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile;
FireWallProfile.AuthorizedApplications.Remove(FileName);
except
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssPostInstall then begin
SetFirewallException('{#MyAppName}', ExpandConstant('{app}')+'\{#MyAppExeName}');
end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usPostUninstall then begin
RemoveFirewallException(ExpandConstant('{app}')+'\{#MyAppExeName}');
end;
end;

AlexM22204
08-08-2015, 08:44
Здравствуйте! Перепаковал для себя программу InnoExtractor , используя наработки с форума, но никак не пойму как добавить в скрипт ключи для тихой установки: стандартная и портативная. Например, ключ (/VERYSILENT /Standart) - обычная установка, а ключ (/VERYSILENT /Portable) - портативная установка.

Ещё чуть не забыл, как прописать чтобы при ручной установке при выборе портативной установки - путь распаковки был, например, (c:\Portable_Soft\InnoExtractor\).

[Setup]
#define AppExe "{app}\InnoExtractor.exe"

#define AppVer GetFileVersion(AddBackslash(SourcePath) + AppExe)
#define AppName "InnoExtractor"
#define AppPub "(моя сборка)"
#define AppURL "http://www.havysoft.cl/"

AppName = {#AppName}
AppPublisher = {#AppPub}
AppPublisherURL = {#AppURL}
UninstallDisplayIcon = {#AppExe}

DefaultDirName = {pf}\{#AppName}
DefaultGroupName = {#AppName}

AppVersion = {#AppVer}
VersionInfoVersion = {#AppVer}

OutputBaseFilename = Setup_{#AppName}
WizardImageFile=embedded\WizardImage.bmp
WizardSmallImageFile=embedded\WizardSmallImage.bmp
Uninstallable=IsChecked
CreateUninstallRegKey=IsChecked

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl;

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Check: IsChecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked; Check: IsChecked

Name: context; Description: "Добавить {#AppName} в контекстное меню Проводника"; GroupDescription: {cm:AdditionalSetting}; Check: IsChecked

[Registry]
Root: HKCR; SubKey: exefile\shell\{#AppName}; ValueType: string; ValueData: "Открыть в {#AppName}"; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKCR; SubKey: exefile\shell\{#AppName}; ValueType: string; ValueName: Icon; ValueData: {#AppExe},0; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKCR; SubKey: exefile\shell\{#AppName}\command; ValueType: string; ValueData: """{#AppExe}"" ""%1"""; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty

[Icons]
Name: "{group}\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0;
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"; Check: "IsChecked"; MinVersion: 0.0,5.0;
Name: "{commondesktop}\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0; OnlyBelowVersion: 0.0,6.01;

[Files]
Source: "{app}\7z.dll"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\7z.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\7zSD.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Init.dat"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: restartreplace overwritereadonly ignoreversion uninsremovereadonly
Source: "{app}\InnoExtractor.exe"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Innounp.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Rops.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Idiomas\English.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Idiomas\Russian.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Idiomas\Spanish.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{userappdata}\InnoExtractor\Config.ini"; DestDir: "{userappdata}\InnoExtractor"; Check: "IsChecked"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: "{app}\Config.ini"; DestDir: "{app}"; Check: "not IsChecked"; MinVersion: 0.0,5.0; Flags: ignoreversion

[CustomMessages]
AdditionalSetting=Дополнительные настройки:
HeaderLabelPage=Выбор типа установки
LabelPage=Выберите нужный тип установки
MyRadioCaption_1=Распаковка
MyRadioCaption_2=Обычная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Будет произведена распаковка в папку, указанную на следующей странице
MyText_2=Будет произведена стандартная установка
Extracted=Распаковка — %1
ExtractedFolder=Выбор папки распаковки
ExtractedFolder2=В какую папку вы хотите распаковать %1?
ExtractedFolder3=Программа распакует %1 в следующую папку.
ExtractedFolder4=Программа установит %1 в следующую папку.
Installing=Распаковка...
InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер.
FinishedHeadingLabel=Завершение распаковки%n%1
FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки.

[UninstallDelete]
Type: filesandordirs; Name: {app}

[Code]
///
var
MyNewPage: TWizardPage;
BitmapImage1,BitmapImage2: TBitmapImage;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(100);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Top:= ScaleY(118);
Width:= WizardForm.InnerNotebook;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
if IsChecked then
WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else
WizardForm.DirEdit.Text := ExpandConstant( '{sd}\Portable_Soft\{#SetupSetting("AppName")}' );
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;

habib2302
08-08-2015, 09:12
AlexM22204, Вот изучайте мой скрипт
http://goo.gl/crKGe3

AlexM22204
08-08-2015, 15:17
habib2302, спасибо за пример, кое-что подсмотрел :cool:
Ещё чуть не забыл, как прописать чтобы при ручной установке при выборе портативной установки - путь распаковки был, например, (c:\Portable_Soft\InnoExtractor\). »
Но с выбором тихой установки: стандартная и портативная, у вас немного не так (у вас ключ выбирается через секцию [Components], а в моём варианте - через RadioButton) :sorry:
http://s020.radikal.ru/i721/1508/2d/bc30e8bec655t.jpg (http://radikal.ru/F/s020.radikal.ru/i721/1508/2d/bc30e8bec655.jpg.html)

us_ov
08-08-2015, 15:48
127825 в этой форме скрыта кнопка обзор
подскажите как удлинить поле ввода (по жирной стрелке)

[Code]
var
cbDrive: TComboBox;
DrvLetters: array of string;
FreeSpaceLabel: TLabel;

function GetDriveType(lpDisk: string): integer;
external 'GetDriveTypeA@kernel32.dll stdcall';

function GetLogicalDriveStrings(nLenDrives: LongInt; lpDrives: string): integer;
external 'GetLogicalDriveStringsA@kernel32.dll stdcall';

const
DRIVE_UNKNOWN=0;
DRIVE_NO_ROOT_DIR=1;
DRIVE_REMOVABLE=2;
DRIVE_FIXED=3;
DRIVE_REMOTE=4;
DRIVE_CDROM=5;
DRIVE_RAMDISK=6;

function DriveTypeString(dtype: integer): string;
begin
case dtype of
DRIVE_NO_ROOT_DIR: Result:='Неверный путь';
DRIVE_REMOVABLE: Result:='Съемный';
DRIVE_FIXED: Result:='Фиксированный';
DRIVE_REMOTE: Result:='Сетевой';
DRIVE_CDROM: Result:='CD-ROM';
DRIVE_RAMDISK: Result:='Ram диск';
else
Result:='Неизвестный';
end;
end;

procedure cbDriveOnClick(Sender: TObject);
begin
WizardForm.DirEdit.Text:=DrvLetters[cbDrive.ItemIndex]+'My Prog';
end;

procedure FillCombo();
var
n: integer;
drivesletters: string; lenletters: integer;
drive: string;
disktype, posnull: integer;
sd: string;
begin
sd:=UpperCase(ExpandConstant('{sd}'));
drivesletters:=StringOfChar(' ', 64);
lenletters:=GetLogicalDriveStrings(63, drivesletters);
SetLength(drivesletters, lenletters);
drive:='';
n:=0;
while ((Length(drivesletters) > 0)) do
begin
posnull:=Pos(#0, drivesletters);
if posnull > 0 then
begin
drive:=UpperCase(Copy(drivesletters, 1, posnull-1));
disktype:=GetDriveType(drive);
if ( not ( disktype = DRIVE_CDROM ) ) then
begin
cbDrive.Items.Add(drive+DriveTypeString(disktype))
SetArrayLength(DrvLetters, N+1);
DrvLetters[n]:=drive;
if (Copy(drive, 1, 2)=sd) then cbDrive.ItemIndex:=n;
n:=n+1;
end
drivesletters:=Copy(drivesletters, posnull+1, Length(drivesletters));
end
end;
cbDriveOnClick(cbDrive);
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: string;
FreeMB, TotalMB: cardinal;
begin
Path:=ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption:='Свободно на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else
FreeSpaceLabel.Caption:='Свободно на диске: ' + IntToStr(FreeMB) + ' MB'
end;

procedure InitializeWizard();

begin
cbDrive:=TComboBox.Create(WizardForm.SelectDirPage);
FreeSpaceLabel:=TLabel.Create(WizardForm);
with cbDrive do
begin
Parent:=WizardForm.DirEdit.Parent;
Left:=WizardForm.DirEdit.Left;
Top:=WizardForm.DirEdit.Top+WizardForm.DirEdit.Height*2-15;
Width:=WizardForm.DirEdit.Width+82;
Style:=csDropDownList;
end
with FreeSpaceLabel do
begin
Parent:=WizardForm.SelectDirPage;
Left:=ScaleX(0);
Top:=Scaley(195);
Width:=ScaleX(209);
Height:=ScaleY(13);
end;
WizardForm.DirBrowseButton.Visible:=False;
WizardForm.DirEdit.Enabled:=true;
WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text+#0;
FillCombo;
cbDrive.OnClick:=@cbDriveOnClick;
end;

TryRooM
08-08-2015, 16:40
us_ov, Примерно так

var
cbDrive: TComboBox;
DrvLetters: array of string;
FreeSpaceLabel: TLabel;

function GetDriveType(lpDisk: string): integer;
external 'GetDriveTypeA@kernel32.dll stdcall';

function GetLogicalDriveStrings(nLenDrives: LongInt; lpDrives: string): integer;
external 'GetLogicalDriveStringsA@kernel32.dll stdcall';

const
DRIVE_UNKNOWN=0;
DRIVE_NO_ROOT_DIR=1;
DRIVE_REMOVABLE=2;
DRIVE_FIXED=3;
DRIVE_REMOTE=4;
DRIVE_CDROM=5;
DRIVE_RAMDISK=6;

function DriveTypeString(dtype: integer): string;
begin
case dtype of
DRIVE_NO_ROOT_DIR: Result:='Неверный путь';
DRIVE_REMOVABLE: Result:='Съемный';
DRIVE_FIXED: Result:='Фиксированный';
DRIVE_REMOTE: Result:='Сетевой';
DRIVE_CDROM: Result:='CD-ROM';
DRIVE_RAMDISK: Result:='Ram диск';
else
Result:='Неизвестный';
end;
end;

procedure cbDriveOnClick(Sender: TObject);
begin
WizardForm.DirEdit.Text:=DrvLetters[cbDrive.ItemIndex]+'!Po';
end;

procedure FillCombo();
var
n: integer;
drivesletters: string; lenletters: integer;
drive: string;
disktype, posnull: integer;
sd: string;
begin
sd:=UpperCase(ExpandConstant('{sd}'));
drivesletters:=StringOfChar(' ', 64);
lenletters:=GetLogicalDriveStrings(63, drivesletters);
SetLength(drivesletters, lenletters);
drive:='';
n:=0;
while ((Length(drivesletters) > 0)) do
begin
posnull:=Pos(#0, drivesletters);
if posnull > 0 then
begin
drive:=UpperCase(Copy(drivesletters, 1, posnull-1));
disktype:=GetDriveType(drive);
if ( not ( disktype = DRIVE_CDROM ) ) then
begin
cbDrive.Items.Add(drive+DriveTypeString(disktype))
SetArrayLength(DrvLetters, N+1);
DrvLetters[n]:=drive;
if (Copy(drive, 1, 2)=sd) then cbDrive.ItemIndex:=n;
n:=n+1;
end
drivesletters:=Copy(drivesletters, posnull+1, Length(drivesletters));
end
end;
cbDriveOnClick(cbDrive);
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: string;
FreeMB, TotalMB: cardinal;
begin
Path:=ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption:='Свободно на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else
FreeSpaceLabel.Caption:='Свободно на диске: ' + IntToStr(FreeMB) + ' MB'
end;

procedure InitializeWizard();

begin
cbDrive:=TComboBox.Create(WizardForm.SelectDirPage);
FreeSpaceLabel:=TLabel.Create(WizardForm);
with cbDrive do
begin
Parent:=WizardForm.DirEdit.Parent;
Left := ScaleX(0);
// Left:=WizardForm.DirEdit.Left+41; // 41
Top:=WizardForm.DirEdit.Top+WizardForm.DirEdit.Height*2-15; //2-15
// Width:=WizardForm.DirEdit.Width;
Width := ScaleX(400); //размер
Style:=csDropDownList;
end
with FreeSpaceLabel do
begin
Parent:=WizardForm.SelectDirPage;
Left:=ScaleX(0);
Top:=Scaley(195);
Width:=ScaleX(209); //209
Height:=ScaleY(13);
end;
WizardForm.DirBrowseButton.Visible:=false; // False
WizardForm.DirEdit.Enabled:=true;
WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text+#0;
FillCombo;
cbDrive.OnClick:=@cbDriveOnClick;

with WizardForm.DirEdit do
begin
Left := ScaleX(0);
Top := ScaleY(80); //выше ниже
Height := ScaleY(23);
Width:=ScaleX(400); //209 размер
end;

with WizardForm.DirBrowseButton do// пришлось сдвинуть обзор
begin
Left := ScaleX(0);
Top := ScaleY(150);
Height := ScaleY(30);
end;
end;

us_ov
08-08-2015, 17:11
TryRooM, СПАСИБО!

vadjliss
08-08-2015, 19:12
парни нужна помощь срочно на скрине думаю всё понятно
http://piccash.net/allimage/2015/8-8/img_thumb/464461-thumb.png (http://piccash.net/27967/464461/)

TryRooM
08-08-2015, 20:58
vadjliss,
[Setup]
;AllowNoIcons=yes не создавать папку в меню пуск

Вы закомментировали?

Посмотрите, у вас в коде нет этого.
var
No_Icons_CheckBox: TNewCheckBox;

vadjliss
08-08-2015, 21:32
TryRooM
[Setup]
;AllowNoIcons=yes не создавать папку в меню пуск
не отключает

Nordek
08-08-2015, 21:52
vadjliss, Удалите:
AllowNoIcons=yes

или замените yes на no:
AllowNoIcons=no

palsn2000
09-08-2015, 07:29
Здравствуйте.
Решил сделать слайдшоу, нашел пример с использованием isgsg.dll:

[_Code]
.......
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then begin
ExtractTemporaryFile('Screen (1).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (1).jpg');
ExtractTemporaryFile('Screen (2).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (2).jpg');
ExtractTemporaryFile('Screen (3).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (3).jpg');
ExtractTemporaryFile('Screen (4).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (4).jpg');
ExtractTemporaryFile('Screen (5).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (5).jpg');
ExtractTemporaryFile('Screen (6).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (6).jpg');
ExtractTemporaryFile('Screen (7).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (7).jpg');
ExtractTemporaryFile('Screen (8).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (8).jpg');
ExtractTemporaryFile('Screen (9).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (9).jpg');
ExtractTemporaryFile('Screen (10).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (10).jpg');
ExtractTemporaryFile('Screen (11).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (11).jpg');
ExtractTemporaryFile('Screen (12).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (12).jpg');
ExtractTemporaryFile('Screen (13).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (13).jpg');
ExtractTemporaryFile('Screen (14).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (14).jpg');
ExtractTemporaryFile('Screen (15).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (15).jpg');
ExtractTemporaryFile('Screen (16).jpg');
ssAddImage(ExpandConstant('{tmp}')+'\Screen (16).jpg');
ssStartShow;
end;
if CurStep=ssPostInstall then ssStopShow;
end;
..........

А можно ли как нибудь прописать показ изображений с помощью цикла - чтобы Inno сам формировал себе список для слайдшоу из изображений, которые найдёт в папке {tmp} ?

vadjliss
11-08-2015, 14:57
нужна помощь
как сделать
чтобы перед установкой удалило старую версию программы
потом установила новую версию
http://piccash.net/allimage/2015/8-11/img_thumb/501159-thumb.png (http://piccash.net/27967/501159/)
с меня плюсик

Sotonisto
12-08-2015, 16:54
перед установкой удалило старую версию программы»
Как-то так:
#define gameid "{11110000-2222-3333-4444-555500000000}"
#define appname "My Program"
#define appversion "1.0"

[Setup]
AppId={{#gameid}
AppName={#appname}
AppVerName={#appname}
AppVersion={#appversion}
DefaultDirName={pf}\{#appname}
OutputDir=.
OutputBaseFilename=setup
Compression=lzma2/ultra64
SolidCompression=true
PrivilegesRequired=poweruser

[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl";

[CustomMessages]
rus.DeleteInfo1=Перед установкой необходимо удалить предыдущую версию приложения. Удалить?
rus.DeleteInfo2=Удаление предыдущей версии приложения завершилось неудачей.

[Code_]
function UninstallMyApp(): Boolean;
var
Buff: String;
i: Integer;
begin
Result:= not RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#gameid}_is1', 'UninstallString', Buff);
if not Result then Result:= not FileExists(RemoveQuotes(Buff));
if not Result then
if MsgBox(ExpandConstant('{cm:DeleteInfo1}'), 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\{#gameid}_is1', 'UninstallString', Buff );
if not Result then MsgBox(ExpandConstant('{cm:DeleteInfo2}'), mbError, MB_OK);
end;
end;

function InitializeSetup(): Boolean;
begin
Result:= UninstallMyApp();
end;

vadjliss
12-08-2015, 19:58
#define gameid "{11110000-2222-3333-4444-555500000000}"
#define appname "My Program"
#define appversion "1.0"
[Setup]
AppId={{#gameid}
AppName={#appname}
AppVerName={#appname}
AppVersion={#appversion}
DefaultDirName={pf}\{#appname}
OutputDir=.
OutputBaseFilename=setup
Compression=lzma2/ultra64
SolidCompression=true
PrivilegesRequired=poweruser
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl";
[CustomMessages]
rus.DeleteInfo1=Перед установкой необходимо удалить предыдущую версию приложения. Удалить?
rus.DeleteInfo2=Удаление предыдущей версии приложения завершилось неудачей.
[Code_]
function UninstallMyApp(): Boolean;
var
Buff: String;
i: Integer;
begin
Result:= not RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#gameid}_is1', 'UninstallString', Buff);
if not Result then Result:= not FileExists(RemoveQuotes(Buff));
if not Result then
if MsgBox(ExpandConstant('{cm:DeleteInfo1}'), 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\{#gameid}_is1', 'UninstallString', Buff );
if not Result then MsgBox(ExpandConstant('{cm:DeleteInfo2}'), mbError, MB_OK);
end;
end;
function InitializeSetup(): Boolean;
begin
Result:= UninstallMyApp();
end; »
что то не выходит
не отображаются надписи
ред установкой необходимо удалить предыдущую версию приложения. Удалить?
Удаление предыдущей версии приложения завершилось неудачей.




© OSzone.net 2001-2012