NightW0lf Цитата: ...так чтобы при запуске инсталлятора происходила проверка на наличие Microsoft .NET Framework 2.0 в системе
Тут при распаковке одной программы обнаружил такой [more=скриптик]
#ifdef UNINSTALLQUEST
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ErrorCode: Integer;
begin
case CurUninstallStep of
usPostUninstall:
begin
ShellExec('open', 'http://www.lingobit.com/uninstallfeedback.htm', '', '', SW_SHOW, ewNoWait, ErrorCode);
end;
end;
end;
#endif
var
Page: TWizardPage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
FileList: TListBox;
Directory: TEdit;
Browse: TButton;
procedure AdditionalFiles_Activate(Page: TWizardPage);
begin
end;
function AdditionalFiles_ShouldSkipPage(Page: TWizardPage): Boolean;
begin
Result := False;
end;
function AdditionalFiles_BackButtonClick(Page: TWizardPage): Boolean;
begin
Result := True;
end;
function AdditionalFiles_NextButtonClick(Page: TWizardPage): Boolean;
begin
Result := True;
end;
procedure AdditionalFiles_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean);
begin
end;
procedure Browse_OnClick(Sender: TObject);
var
sDir: String;
begin
sDir := Directory.Text;
if BrowseForFolder('Select a folder in the list below, then click OK.', sDir, true) then Directory.Text := sDir;
end;
function AdditionalFiles_CreatePage(PreviousPageId: Integer): Integer;
begin
Page := CreateCustomPage(
PreviousPageId,
ExpandConstant('{cm:AdditionalFilesCaption}'),
ExpandConstant('{cm:AdditionalFilesDescription}')
);
{ Label1 }
Label1 := TLabel.Create(Page);
with Label1 do
begin
Parent := Page.Surface;
Left := ScaleX(0);
Top := ScaleY(160);
Width := ScaleX(266);
Height := ScaleY(13);
Caption := 'Setup will install additional files into the following folder.';
end;
{ Label2 }
Label2 := TLabel.Create(Page);
with Label2 do
begin
Parent := Page.Surface;
Left := ScaleX(0);
Top := ScaleY(176);
Width := ScaleX(390);
Height := ScaleY(13);
Caption := 'To continue, click Next. If you would like to select a different folder, click Browse.';
end;
{ Label3 }
Label3 := TLabel.Create(Page);
with Label3 do
begin
Parent := Page.Surface;
Left := ScaleX(0);
Top := ScaleY(0);
Width := ScaleX(320);
Height := ScaleY(13);
Caption := 'Following additional files are attached to this installation package. ';
end;
{ FileList }
FileList := TListBox.Create(Page);
with FileList do
begin
Parent := Page.Surface;
Left := ScaleX(0);
Top := ScaleY(24);
Width := ScaleX(409);
Height := ScaleY(121);
TabOrder := 0;
#ifdef PROJECTFILE
Items.Add(ExtractFileName('{#PROJECTFILE}'));
#endif
#ifdef FILE1
Items.Add(ExtractFileName('{#FILE1}'));
#endif
#ifdef FILE2
Items.Add(ExtractFileName('{#FILE2}'));
#endif
#ifdef FILE3
Items.Add(ExtractFileName('{#FILE3}'));
#endif
#ifdef FILE4
Items.Add(ExtractFileName('{#FILE4}'));
#endif
#ifdef FILE5
Items.Add(ExtractFileName('{#FILE5}'));
#endif
end;
{ Directory }
Directory := TEdit.Create(Page);
with Directory do
begin
Parent := Page.Surface;
Left := ScaleX(0);
Top := ScaleY(200);
Width := ScaleX(329);
Height := ScaleY(21);
TabOrder := 1;
Text := ExpandConstant('{userdocs}\Lingobit Localizer');
end;
{ Browse }
Browse := TButton.Create(Page);
with Browse do
begin
Parent := Page.Surface;
Left := ScaleX(336);
Top := ScaleY(200);
Width := ScaleX(73);
Height := ScaleY(21);
Caption := 'Browse...';
TabOrder := 2;
OnClick:= @Browse_OnClick;
end;
with Page do
begin
OnActivate := @AdditionalFiles_Activate;
OnShouldSkipPage := @AdditionalFiles_ShouldSkipPage;
OnBackButtonClick := @AdditionalFiles_BackButtonClick;
OnNextButtonClick := @AdditionalFiles_NextButtonClick;
OnCancelButtonClick := @AdditionalFiles_CancelButtonClick;
end;
Result := Page.ID;
end;
procedure InitializeWizard();
begin
#ifdef PROJECTFILE
AdditionalFiles_CreatePage(wpSelectDir);
#endif
end;
function GetAdditionalDir(t: String):String;
begin
Result:=Directory.Text;
end;
function GetProjectTgtDir(t: String):String;
begin
#ifdef PROJECTFILE
Result:=AddBackslash(GetAdditionalDir(''))+ExtractFileName('{#PROJECTFILE}');
#endif
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
S: String;
begin
S := '';
S := S + MemoDirInfo + NewLine + NewLine;
#ifdef PROJECTFILE
S := S + 'Additional Files Directory:' + NewLine;
S := S + Space + Directory.Text + NewLine + NewLine;
#endif
// S := S + MemoTypeInfo + NewLine + NewLine;
// S := S + MemoComponentsInfo + NewLine + NewLine;
S := S + MemoGroupInfo + NewLine + NewLine;
S := S + MemoTasksInfo;
Result:=S;
end;
function ShouldSkipPage(CurPage: Integer): Boolean;
begin
if Pos('/SP-', UpperCase(GetCmdTail)) > 0 then
case CurPage of
wpWelcome, wpLicense, wpPassword, wpInfoBefore, wpUserInfo,
wpSelectDir, wpSelectProgramGroup, wpInfoAfter:
Result := True;
end;
end;
function IsDotNET11Detected(): boolean;
var
NetSuccess: boolean;
NetInstall: cardinal;
begin
NetSuccess := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322', 'Install', NetInstall);
Result := NetSuccess and (NetInstall = 1);
end;
procedure DeinitializeSetup();
var
issiNetDetect: boolean;
begin
if not IsDotNET11Detected then begin
MsgBox(ExpandConstant('{cm:IssiRequiresNet}'), mbInformation, MB_OK);
issiNetDetect := false;
end else begin
issiNetDetect := true;
end;
RegWriteStringValue(HKEY_CURRENT_USER, 'Software\Lingobit\Lingobit Localizer','GUILanguage', ExpandConstant('{language}'));
#ifdef REGKEYPATH
if RegValueExists(HKEY_CURRENT_USER, '{#REGKEYPATH}', 'Key') then
begin
if MsgBox('Lingobit Localizer is already registered on this computer. Update registration information?', mbConfirmation, MB_YESNO) = IDYES then
begin
RegWriteStringValue(HKEY_CURRENT_USER, '{#REGKEYPATH}', 'Key', '{#REGKEYVALUE}');
end;
end;
if not RegValueExists(HKEY_CURRENT_USER, '{#REGKEYPATH}', 'Key') then
RegWriteStringValue(HKEY_CURRENT_USER, '{#REGKEYPATH}', 'Key', '{#REGKEYVALUE}');
#endif
end;
function InitializeSetup(): Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
if Version.Major < 5 then
begin
SuppressibleMsgBox('Microsoft Windows 2000, Microsoft Windows XP or higher is required.',
mbCriticalError, MB_OK, MB_OK);
Result := False;
Exit;
end;
Result := True;
end;
[/more]
Там правда описывается для версии 1.1, но кое что почерпнуть можно.
Программа
Inno Script Generator обновилась до версии
1.0.2.5 (02. April 2007) Если вдруг кому то захочется перевести эту программу, то:
1. Качаем DKLang Localization Package (Прога бесплатная) _http://www.dk-soft.org/download.php?lang=ru&cat_id=4
2. В папке с Inno Script Generator находится файл InnoScriptGenerator.dklang (Его используем в качестве исходного языкового файла)
3. Дальше либо создаём новый файл перевода, либо берём мой _http://filepost.ru/?act=files&id=3340218 или _http://keygen.ifolder.ru/1559987 (перевёл немного для проверки софтины).