Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
та же фигня уже не знаю что пробовать(
Gnom_aka_Lexander
23-03-2011, 18:16
shidow, покажи весь скрипт, можно без секции кода, если он секретный :)
Скрипт
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVersion}
AppVersion={#MyAppVersion}
VersionInfoVersion={#vers1}
VersionInfoTextVersion={#vers1}
AppPublisher={#MyAppPublisher}
AppCopyright=shidow
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
SolidCompression=yes
SetupIconFile=D:\RePack\Games\icon.ico
ShowTasksTreeLines=yes
OutputDir=D:\RePack\Games
DisableReadyPage=True
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.Welcome=Приветствие
rus.components1=Компоненты
rus.Catalogue=Каталог
rus.StartMenu=Меню «Пуск»
rus.Task=Задачи
rus.Installing=Установка
rus.Uninstalling=Удаление
rus.Finish=Завершение
rus.SelectDir=Выбор папки установки
rus.SelectComponents=Выбор компонентов
rus.SelectProgramGroup=Выберите папку в меню «Пуск»
rus.SelectTasks=Выберите дополнительные задачи
rus.Installing1=Установка...
rus.Welcome1=Вас приветствует Мастер установки {#MyAppName}
rus.Welcome2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из%nпрограммы установки.
rus.UninstDescript=Пожалуйста, подождите, пока игра устновится на Ваш компьютер.
rus.FinishedHeading=Установка {#MyAppName} успешно завершена.
rus.FinishedLabel=Игра {#MyAppName} была успешно установлена на Ваш компьютер.%n%nДля ее запуска выберите соответствующий ярлык в меню «Пуск» или на%nРабочем столе.%n%nНажмите «Завершить», чтобы выйти из программы установки.
rus.Task_lbl1=Создать значки на &Рабочем столе
rus.Task_lbl2=Установить &EA Download Manager
rus.Task_lbl3=Обновить &DirectX
rus.Icons1=Начать игру
rus.Icons2=Удалить игру
rus.Icons3=Руководство пользователя
rus.fin3=Установка игры {#MyAppName} не завершена.
rus.fin4=Во время установки игры {#MyAppName} произошла ошибка, пожалуйста отключите сторонние программы и повторите%nпопытку установки.%n%nНажмите «Завершить», чтобы выйти из программы установки.
rus.Error=Ошибка
rus.ru1=В пути установки присутствуют русские буквы, что недопустимо.
rus.ru2=Пожалуйста, повторите ввод.
[Icons]
Name: "{group}\{cm:Icons1}"; Filename: "{app}\{#MyAppExeName}"; Workingdir:"{app}"; Check: NoIcons
Name: "{group}\{cm:Icons2}"; Filename: "{uninstallexe}"; Workingdir:"{app}"; Check: NoIcons
Name: "{userdesktop}\{#MyAppName}"; IconFilename: "D:\RePack\Games\icon.ico"; Filename: "{app}\{#MyAppExeName}"; Check: Task1;
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: D:\Games\1\bin\start.exe; DestDir: {app}; Flags: ignoreversion
Source: D:\Games\1\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Files\botva2.dll"; Flags: dontcopy
Source: "Files\InnoCallback.dll"; Flags: dontcopy
Source: "fon.jpg"; Flags: dontcopy
Source: "Logo.png"; Flags: dontcopy
//Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs
//Source: Files\*; Flags: dontcopy
[Run]
Filename: "{app}\Redistributable\eadm-installer.exe"; WorkingDir: "{app}\Redistributable"; Flags: postinstall; Check: Task2;
Filename: "{app}\Redistributable\DirectX\DXSETUP.exe"; Parameters:/silent; WorkingDir: "{app}\Redistributable\DirectX\"; Flags: postinstall; Check: Task3;
Gnom_aka_Lexander
23-03-2011, 18:42
shidow, Теперь смотри- ты запускаеш содержиме папки Redistributable из папки с устанавливаемой программой, но нигде не кладеш эту папку туда, у тебя получается, что нет файлов для запуска.
[Run]
Filename: "{app}\Redistributable\eadm-installer.exe"; WorkingDir: "{app}\Redistributable"; Flags: postinstall; Check: Task2;
Filename: "{app}\Redistributable\DirectX\DXSETUP.exe"; Parameters:/silent; WorkingDir: "{app}\Redistributable\DirectX\"; Flags: postinstall; Check: Task3;
{app} - это куда устанавливается программа. А где у тебя лежит папка Redistributable?
если рядом с инсталлятором, то замени {app} на {src}
insombia
23-03-2011, 18:46
Лександер вставляю код и при создании установки ошибки кидает что делать не подскажеш?
Gnom_aka_Lexander
23-03-2011, 18:47
insombia, Вставлять код с умом и описывать ошибки. Я, конечно, телепат, но не до такой степени.
attachmentid
помогите пожалуйста вот скрипт скомпилировал создал образ установил но она не доустановиласт то есть не завершена установка доп оборудования не установилась и не появились ярлыки
Но она доступна только на Юникод-версии компилятора. Вопрос: как-бы ее приделать к АНСИ-компилятору? »
Действительно, стандартная функция вылетает с ошибкой...
В принципе этот момент можно обойти написав свою функцию. Накидал две функции ANSI<->UTF8:
function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD;
lpMultiByteStr: PAnsiChar; cbMultiByte: Integer;
lpWideCharStr: PAnsiChar; cchWideChar: Integer): Longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD;
lpWideCharStr: PAnsiChar; cchWideChar: Integer; lpMultiByteStr: PAnsiChar;
cbMultiByte: Integer; lpDefaultChar: Integer; lpUsedDefaultChar: Integer): Longint;
external 'WideCharToMultiByte@kernel32.dll stdcall';
function AnsiToUtf8(aStr: string): string;
// функция преобразовывает ANSI строку в UTF-8
var
wStr: string;
begin
try
SetLength(wStr, MultiByteToWideChar(0, 0, aStr, -1, '', 0)*2);
MultiByteToWideChar(0, 0, aStr, -1, wStr, Length(wStr));
SetLength(Result, WideCharToMultiByte(65001, 0, wStr, -1, '', 0, 0, 0)-1);
WideCharToMultiByte(65001, 0, wStr, -1, Result, Length(Result), 0, 0);
Result := #$EF#$BB#$BF + Result;
finally
SetLength(wStr, 0);
end;
end;
function Utf8ToAnsi(wStr: string): string;
// функция преобразовывает UTF-8 строку в ANSI
var
aStr: string;
begin
try
while (wStr <> '') and ((wStr[1] = #$EF) or (wStr[1] = #$BB) or (wStr[1] <> #$BF)) do
Delete(wStr, 1, 1);
SetLength(aStr, MultiByteToWideChar(65001, 0, wStr, -1, '', 0)*2);
MultiByteToWideChar(65001, 0, wStr, -1, aStr, Length(aStr));
SetLength(Result, WideCharToMultiByte(0, 0, aStr, -1, '', 0, 0, 0)-1);
WideCharToMultiByte(0, 0, aStr, -1, Result, Length(Result), 0, 0);
finally
SetLength(aStr, 0);
end;
end;
у меня есть скрипт для распаковки freearc архивов.
что туда добавить, чтобы он распаковывал и precomp архивы?
Проблема пропало только на половину. Устанавливается только одно доп ПО и в независимости поставить или нет галку в инстале она устанавливается((
insombia
24-03-2011, 20:36
как вставить кнопки в инсталлятор красивые? я со скрипта Need for Speed™ Undercover.iss v 2.2 вставлял мне ошибки кидает
Gnom_aka_Lexander
24-03-2011, 21:39
insombia, Шапка - Показать/скрыть: Справка, руководство, примеры: - Показать/скрыть: Ссылки на примеры скриптов: - Наложение изображений на стандартные кнопки (http://forum.oszone.net/post-1241045-224.html)
C783RPunk
25-03-2011, 12:17
Здравствуйте, а как полностью отключить системное меню, то которое открывается при нажатии на иконку, расположенную в левой части заголовка окна (Восстановить, Переместить, Размер, Свернуть, Развернуть, Закрыть)?
insombia
25-03-2011, 12:25
insombia, Шапка - Показать/скрыть: Справка, руководство, примеры: - Показать/скрыть: Ссылки на примеры скриптов: - Наложение изображений на стандартные кнопки »
Пробывал не работает
Здравствуйте, накидал скрипт для конвертирования строк в различные форматы:
[Code]
{===============================================================================}
{ Script name: ConvertString.iss }
{ Script version: 1.1 }
{ Author: Serega, http://forum.oszone.net/member.php?userid=88670 }
{ }
{ Include this file in project. }
{ Example: }
{ #include "ConvertString.iss" }
{===============================================================================}
{ Rev 1.1 26.03.2011 22:36:43 }
{ - fixed error is corrected at compilation on the expanded }
{ version from Restools; }
{ - function ClearBom is optimised. }
{ Rev 1.0 25.03.2011 18:58:04 Create }
{===============================================================================}
{ Supported functions }
{===============================================================================}
{ ANSI -> }
{ function AnsiToUtf8(const SourceStr: string): string; }
{ function AnsiToUtf7(const SourceStr: string): string; }
{ function AnsiToUtf16(const SourceStr: string): string; }
{ function AnsiToDos(const SourceStr: string): string; }
{ function AnsiToKoi(const SourceStr: string): string; }
{ function AnsiToIso(const SourceStr: string): string; }
{ function AnsiToMac(const SourceStr: string): string; }
{ UTF-7 -> }
{ function Utf7ToAnsi(const SourceStr: string): string; }
{ function Utf7ToUtf8(const SourceStr: string): string; }
{ function Utf7ToUtf16(const SourceStr: string): string; }
{ function Utf7ToDos(const SourceStr: string): string; }
{ function Utf7ToKoi(const SourceStr: string): string; }
{ function Utf7ToIso(const SourceStr: string): string; }
{ function Utf7ToMac(const SourceStr: string): string; }
{ UTF-8 -> }
{ function Utf8ToAnsi(const SourceStr: string): string; }
{ function Utf8ToUtf7(const SourceStr: string): string; }
{ function Utf8ToUtf16(const SourceStr: string): string; }
{ function Utf8ToDos(const SourceStr: string): string; }
{ function Utf8ToKoi(const SourceStr: string): string; }
{ function Utf8ToIso(const SourceStr: string): string; }
{ function Utf8ToMac(const SourceStr: string): string; }
{ UTF-16 (Unicode) -> }
{ function Utf16ToAnsi(const SourceStr: string): string; }
{ function Utf16ToUtf7(const SourceStr: string): string; }
{ function Utf16ToUtf8(const SourceStr: string): string; }
{ function Utf16ToDos(const SourceStr: string): string; }
{ function Utf16ToKoi(const SourceStr: string): string; }
{ function Utf16ToIso(const SourceStr: string): string; }
{ function Utf16ToMac(const SourceStr: string): string; }
{ DOS (cp866) -> }
{ function DosToAnsi(const SourceStr: string): string; }
{ function DosToUtf7(const SourceStr: string): string; }
{ function DosToUtf8(const SourceStr: string): string; }
{ function DosToUtf16(const SourceStr: string): string; }
{ function DosToKoi(const SourceStr: string): string; }
{ function DosToIso(const SourceStr: string): string; }
{ function DosToMac(const SourceStr: string): string; }
{ KOI (KOI-8) -> }
{ function KoiToAnsi(const SourceStr: string): string; }
{ function KoiToUtf7(const SourceStr: string): string; }
{ function KoiToUtf8(const SourceStr: string): string; }
{ function KoiToUtf16(const SourceStr: string): string; }
{ function KoiToDos(const SourceStr: string): string; }
{ function KoiToIso(const SourceStr: string): string; }
{ function KoiToMac(const SourceStr: string): string; }
{ ISO (iso-8859) -> }
{ function IsoToAnsi(const SourceStr: string): string; }
{ function IsoToUtf7(const SourceStr: string): string; }
{ function IsoToUtf8(const SourceStr: string): string; }
{ function IsoToUtf16(const SourceStr: string): string; }
{ function IsoToDos(const SourceStr: string): string; }
{ function IsoToKoi(const SourceStr: string): string; }
{ function IsoToMac(const SourceStr: string): string; }
{ MAC -> }
{ function MacToAnsi(const SourceStr: string): string; }
{ function MacToUtf7(const SourceStr: string): string; }
{ function MacToUtf8(const SourceStr: string): string; }
{ function MacToUtf16(const SourceStr: string): string; }
{ function MacToDos(const SourceStr: string): string; }
{ function MacToKoi(const SourceStr: string): string; }
{ function MacToIso(const SourceStr: string): string; }
{===============================================================================}
{===============================================================================}
#if Ver < 84084736
type
PAnsiChar = PChar; // Required for Inno Setup 5.3.0 and lower
#endif
const
Utf8Bom = #$EF#$BB#$BF;
Utf16Bom = #$FF#$FE;
CP_ACP = 0; { default to ANSI code page }
CP_OEMCP = 1; { default to OEM code page }
CP_MACCP = 2; { default to MAC code page }
CP_UTF16 = 1200; { UTF-16 translation }
CP_ISO = 28595; { iso-8859-5 translation }
CP_KOI8 = 20866; { KOI-8 translation }
CP_UTF7 = 65000; { UTF-7 translation }
CP_UTF8 = 65001; { UTF-8 translation }
function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD;
lpMultiByteStr: PAnsiChar; cbMultiByte: Integer;
lpWideCharStr: PAnsiChar; cchWideChar: Integer): Longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD;
lpWideCharStr: PAnsiChar; cchWideChar: Integer; lpMultiByteStr: PAnsiChar;
cbMultiByte: Integer; lpDefaultChar: Integer; lpUsedDefaultChar: Integer): Longint;
external 'WideCharToMultiByte@kernel32.dll stdcall';
function WideStringToString(const wStr: string; codePage: Word): string;
var
len: Integer;
begin
len := WideCharToMultiByte(codePage, 0, wStr, -1, '', 0, 0, 0);
if len > 0 then
begin
SetLength(Result, len-1);
WideCharToMultiByte(codePage, 0, wStr, -1, Result, Length(Result), 0, 0);
end;
end;
function StringToWideString(const aStr: string; codePage: Word): string;
var
len: Integer;
begin
len := MultiByteToWideChar(codePage, 0, aStr, -1, '', 0);
if len > 0 then
begin
SetLength(Result, (len*2)-2);
MultiByteToWideChar(codePage, 0, aStr, -1, Result, Length(Result));
end;
end;
function ClearBom(const s, sig: string): string;
var
i, n, len: Integer;
begin
Result := s;
len := Length(sig);
n := 0;
if (len > 0) and (Length(Result) > len) then
repeat
for i := 1 to len do
if Result[1] = sig[i] then
begin
Delete(Result, 1, 1);
Break;
end;
n := n + 1;
until (n = len) or (Result = '');
end;
{===============================================================================}
{===============================================================================}
{ ANSI -> }
{===============================================================================}
function AnsiToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_UTF8);
end;
function AnsiToUtf7(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_UTF7);
end;
function AnsiToUtf16(const SourceStr: string): string;
begin
Result := Utf16Bom + StringToWideString(SourceStr, CP_ACP);
end;
function AnsiToDos(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_OEMCP);
end;
function AnsiToKoi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_KOI8);
end;
function AnsiToIso(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_ISO);
end;
function AnsiToMac(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ACP), CP_MACCP);
end;
{===============================================================================}
{ UTF-7 -> }
{===============================================================================}
function Utf7ToAnsi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_ACP);
end;
function Utf7ToUtf8(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_UTF8);
end;
function Utf7ToUtf16(const SourceStr: string): string;
begin
Result := StringToWideString(SourceStr, CP_UTF7);
end;
function Utf7ToDos(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_OEMCP);
end;
function Utf7ToKoi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_KOI8);
end;
function Utf7ToIso(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_ISO);
end;
function Utf7ToMac(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_UTF7), CP_MACCP);
end;
{===============================================================================}
{ UTF-8 -> }
{===============================================================================}
function ConvertUtf8(const SourceStr: string; codePage: Word): string;
var
wStr: string;
begin
try
wStr := ClearBom(SourceStr, Utf8Bom);
Result := WideStringToString(StringToWideString(wStr, CP_UTF8), codePage);
finally
SetLength(wStr, 0);
end;
end;
function Utf8ToAnsi(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_ACP);
end;
function Utf8ToUtf7(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_UTF7);
end;
function Utf8ToUtf16(const SourceStr: string): string;
begin
Result := StringToWideString(SourceStr, CP_UTF8);
end;
function Utf8ToDos(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_OEMCP);
end;
function Utf8ToKoi(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_KOI8);
end;
function Utf8ToIso(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_ISO);
end;
function Utf8ToMac(const SourceStr: string): string;
begin
Result := ConvertUtf8(SourceStr, CP_MACCP);
end;
{===============================================================================}
{ UTF-16 (Unicode) -> }
{===============================================================================}
function ConvertUtf16(const SourceStr: string; codePage: Word): string;
var
wStr: string;
begin
try
wStr := ClearBom(SourceStr, Utf16Bom);
Result := WideStringToString(wStr, codePage);
finally
SetLength(wStr, 0);
end;
end;
function Utf16ToAnsi(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_ACP);
end;
function Utf16ToUtf7(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_UTF7);
end;
function Utf16ToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + ConvertUtf16(SourceStr, CP_UTF8);
end;
function Utf16ToDos(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_OEMCP);
end;
function Utf16ToKoi(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_KOI8);
end;
function Utf16ToIso(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_ISO);
end;
function Utf16ToMac(const SourceStr: string): string;
begin
Result := ConvertUtf16(SourceStr, CP_MACCP);
end;
{===============================================================================}
{ DOS (cp866) -> }
{===============================================================================}
function DosToAnsi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_ACP);
end;
function DosToUtf7(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_UTF7);
end;
function DosToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_UTF8);
end;
function DosToUtf16(const SourceStr: string): string;
begin
Result := Utf16Bom + StringToWideString(SourceStr, CP_OEMCP);
end;
function DosToKoi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_KOI8);
end;
function DosToIso(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_ISO);
end;
function DosToMac(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_OEMCP), CP_MACCP);
end;
{===============================================================================}
{ KOI (KOI-8) -> }
{===============================================================================}
function KoiToAnsi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_ACP);
end;
function KoiToUtf7(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_UTF7);
end;
function KoiToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_UTF8);
end;
function KoiToUtf16(const SourceStr: string): string;
begin
Result := Utf16Bom + StringToWideString(SourceStr, CP_KOI8);
end;
function KoiToDos(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_OEMCP);
end;
function KoiToIso(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_ISO);
end;
function KoiToMac(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_KOI8), CP_MACCP);
end;
{===============================================================================}
{ ISO (iso-8859) -> }
{===============================================================================}
function IsoToAnsi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_ACP);
end;
function IsoToUtf7(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_UTF7);
end;
function IsoToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_UTF8);
end;
function IsoToUtf16(const SourceStr: string): string;
begin
Result := Utf16Bom + StringToWideString(SourceStr, CP_ISO);
end;
function IsoToDos(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_OEMCP);
end;
function IsoToKoi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_KOI8);
end;
function IsoToMac(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_ISO), CP_MACCP);
end;
{===============================================================================}
{ MAC -> }
{===============================================================================}
function MacToAnsi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_ACP);
end;
function MacToUtf7(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_UTF7);
end;
function MacToUtf8(const SourceStr: string): string;
begin
Result := Utf8Bom + WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_UTF8);
end;
function MacToUtf16(const SourceStr: string): string;
begin
Result := Utf16Bom + StringToWideString(SourceStr, CP_MACCP);
end;
function MacToDos(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_OEMCP);
end;
function MacToKoi(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_KOI8);
end;
function MacToIso(const SourceStr: string): string;
begin
Result := WideStringToString(StringToWideString(SourceStr, CP_MACCP), CP_ISO);
end;
{===============================================================================}
как полностью отключить системное меню »
procedure InitializeWizard();
begin
WizardForm.BorderStyle := bsDialog;
end;
El Sanchez
25-03-2011, 17:15
Как в скрипте вызвать функцию из WinAPI? Функция GetFileVersionInfo.
Знаю, что в Делфях это делается через подключения в uses модуля Windows.
Как это сделать в InnoSetup??? »
ryabis, если еще актуально определение полей версии файла, то вот вариант:
[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
function GetFileVersionInfoSize(lptstrFilename: String; lpdwHandle: Integer): Integer;
external 'GetFileVersionInfoSize{#A}@version.dll stdcall delayload';
function GetFileVersionInfo(lptstrFilename: String; dwHandle, dwLen: Integer; var lpData: Byte): Boolean;
external 'GetFileVersionInfo{#A}@version.dll stdcall delayload';
function VerQueryValue(var pBlock: Byte; lpSubBlock: String; var lplpBuffer: DWord; var puLen: Integer): Boolean;
external 'VerQueryValue{#A}@version.dll stdcall delayload';
function GetFileVerInfo(FileName, VerName: String): String;
//VerName:
//Comments, LegalCopyright, CompanyName, FileDescription, FileVersion, ProductVersion,
//InternalName, LegalTrademarks, OriginalFilename, ProductName, PrivateBuild, SpecialBuild
var
dwLen, puLen, i: Integer;
lpFileVerInfo: array of Byte;
lplpBufferCP, lplpBufferVN: DWord;
LangCodepage: String;
begin
Result := '';
if FileExists(FileName) then
begin
dwLen := GetFileVersionInfoSize(FileName, 0);
if dwLen > 0 then
begin
SetArrayLength(lpFileVerInfo, dwLen);
if GetFileVersionInfo(FileName, 0, dwLen, lpFileVerInfo[0]) then
begin
if VerQueryValue(lpFileVerInfo[0], '\VarFileInfo\Translation', lplpBufferCP, puLen) then
begin
LangCodepage := Format('%.2x%.2x%.2x%.2x', [lpFileVerInfo[(dwLen div 2)-5], lpFileVerInfo[(dwLen div 2)-6], lpFileVerInfo[(dwLen div 2)-3], lpFileVerInfo[(dwLen div 2)-4]]);
if VerQueryValue(lpFileVerInfo[0], Format('\%s\%s\%s', ['StringFileInfo', LangCodepage, VerName]), lplpBufferVN, puLen) then
begin
i := (dwLen div 2) + lplpBufferVN - lplpBufferCP - 6;
repeat
if lpFileVerInfo[i] <> 0 then
begin
SetLength(Result, Length(Result)+1);
Result[Length(Result)] := Chr(lpFileVerInfo[i]);
end;
i := i + 1;
#ifdef UNICODE
until i > (dwLen div 2) + lplpBufferVN - lplpBufferCP - 8 + puLen;
#else
until lpFileVerInfo[i] = 0;
#endif
end;
end;
end;
end;
end;
end;
C783RPunk
25-03-2011, 17:17
Serega, спс:)
А подскажите пожалуйста еще, как на странице "приветствие установки программы" и "завершение установки" упорядочить текст по центру (сверху-снизу и по бокам), для стандартного скина.
EvilAlex
25-03-2011, 22:20
и как сделать так чтобы, файлы сетапа не в куче в папке с игрой были, а в папке сетап например ...
Так:
игра/игровые файлы
игра/игровые файлы
игра/игровые файлы
игра/сетап/файлы сетапа
А то у меня так:
игра/игровые файлы
игра/игровые файлы
игра/игровые файлы
игра/файлы сетапа
insombia
25-03-2011, 23:03
были, а в папке сетап например ... »
и как сделать так чтобы, файлы сетапа не в куче в папке с игрой были, а в папке сетап например ...
Так:
игра/игровые файлы
игра/игровые файлы
игра/игровые файлы
игра/сетап/файлы сетапа
А то у меня так:
игра/игровые файлы
игра/игровые файлы
игра/игровые файлы
игра/файлы сетапа »
Если я тебя правильно понял то в настройках istool в команде опции-выходной каталог можно выбрать папку в которую сохранять установочные файлы
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.