Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Закрытая тема
Настройки темы
[архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Ветеран


Сообщения: 1133
Благодарности: 581


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: jameszero
Дата: 08-11-2010
Описание: тема закрыта
Лимит страниц.
Тема закрыта.
Продолжение по ссылке Скрипты Inno Setup. Помощь и советы [часть 3]




Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме
Inno Setup. Прочие вопросы.


Показать/скрыть: Справка, руководство, примеры:
Показать/скрыть: Ссылки на примеры скриптов:
Показать/скрыть: Дополнительные программы для Inno Setup:
  • ISTool - неплохой редактор скриптов Inno Setup.
    Последняя версия: 5.3.0.1 [29.09.2009] - Скачать | зеркало;
    Предыдущая версия: 5.3.0 [07.04.2009] - Скачать (зеркало) | Русификатор (зеркало);

  • Inno Script Generator - ещё один редактор скриптов Inno Setup. Обладает некоторыми полезными функциями, которых нет ни у самого Inno Setup, ни у ISTool.
    Последняя версия: 1.0.3.1 [23.03.2008] - Скачать;

  • Inno Setup Form Designer - редактор страниц Inno Setup, можно создавать свои страницы. Официальный сайт - недоступен.
    Последняя версия: 2.0.8 [12.11.2006] - Страница с зеркалами;

  • Inno Setup GameScript Generator - программа генерирует скрипты для Inno Setup . С помощью GameScript Generator и Inno Setup вы сможете быстро создать простенький инсталляционный пакет для любой игры. В инсталлятор можно встроить музыку, слайдшоу и фоновый рисунок. Для специалистов созданный скрипт, возможно, будет неплохой заготовкой для дальнейшей модернизации;

  • ISSkin - Программа для создания и добавления в инсталлятор скинов. Инструкция.
    Последняя версия: 3.0.0.0 [19.01.2010] - Скачать;

  • InnoSetup Script Joiner - Программа для объединения нескольких скриптов InnoSetup в один;

  • Converter - Программа конвертирует reg-файлы в формат *.iss (формат скриптов Inno Setup).
    Последняя версия: 0.1.3 [11.09.2009] - Скачать;


Ссылка на архив предыдущей темы (также можно скачать из вложения)

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.


Отправлено: 22:06, 23-08-2009

 

Новый участник


Сообщения: 14
Благодарности: 3

Профиль | Отправить PM | Цитировать


ISWin7 v0.4.2 обновление от 04.04.2010
Это плагин позволит вам сделать прозрачными края или всё окно целиком.
Работает ТОЛЬКО в Windows 7.
В Windows XP и Windows Vista он пропускает инициализацию что не мешает работоспособности сетапника в этих операционных системах.

Скачать
PS Если кому нужен плагин предоставляющий какие либо новые возможности - пишите - подумаем

Последний раз редактировалось VoLT, 04-04-2010 в 22:07.


Отправлено: 15:15, 03-04-2010 | #1661



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Аватара для Tukash

Пользователь


Сообщения: 109
Благодарности: 5

Профиль | Отправить PM | Цитировать


добрый день, такой вопрос, возможно-ли сделать что-бы определенный файл, установился в папку Windows, но не просто а сам находил на каком диске она находится, C, D, F, ну думаю понятно, это возможно сделать?

Отправлено: 17:40, 03-04-2010 | #1662


Аватара для Habetdin


Автор проектов


Сообщения: 3651
Благодарности: 1498

Профиль | Сайт | Отправить PM | Цитировать


Tukash, это не подходит?
Код: Выделить весь код
[Files]
Source: myprog.exe; DestDir: {win}; Flags: ignoreversion

-------
Рекомендую: $25 на тест виртуального сервера (VPS) за регистрацию по ссылке

Это сообщение посчитали полезным следующие участники:

Отправлено: 19:23, 03-04-2010 | #1663


Аватара для Tukash

Пользователь


Сообщения: 109
Благодарности: 5

Профиль | Отправить PM | Цитировать


Habetdin,
я такие команды не знаю, надо-бы почитать о них, спасибо!

Отправлено: 19:48, 03-04-2010 | #1664


Аватара для Habetdin


Автор проектов


Сообщения: 3651
Благодарности: 1498

Профиль | Сайт | Отправить PM | Цитировать


Tukash,
Constants
Цитата:
Constants
The majority of the script entries can have constants embedded in them. These are predefined strings enclosed in brace characters { }. Setup or Uninstall translates the constants to their literal values, depending on the user's choices and system configuration. For example, {win}, as described below, would translate to "C:\WINDOWS" on most systems.

A "{" character is treated as the start of the constant. If you want to use that actual character in a place where constants are supported, you must use two consecutive "{" characters. (You do not need to double "}" characters.)

When a backslash immediately follows a constant, Setup or Uninstall will automatically remove the backslash if the value of the constant ends in a backslash already. Thus, if the value of a particular constant is "C:\", {constantname}\file will translate to "C:\file", not "C:\\file". If you want to prevent this from happening, enclose the backslash in { } characters, e.g. {app}{\}.

The following is the list of supported constants.

Directory Constants
{app}
The application directory, which the user selects on the Select Destination Location page of the wizard.
For example: If you used {app}\MYPROG.EXE on an entry and the user selected "C:\MYPROG" as the application directory, Setup will translate it to "C:\MYPROG\MYPROG.EXE".

{win}
The system's Windows directory.
For example: If you used {win}\MYPROG.INI on an entry and the system's Windows directory is "C:\WINDOWS", Setup or Uninstall will translate it to "C:\WINDOWS\MYPROG.INI".

{sys}
The system's System32 directory (System on Windows 95/98/Me).
For example: If you used {sys}\CTL3D32.DLL on an entry and the system's Windows System directory is "C:\WINDOWS\SYSTEM", Setup or Uninstall will translate it to "C:\WINDOWS\SYSTEM\CTL3D32.DLL".

On 64-bit Windows, by default, the System32 path returned by this constant maps to the directory containing 32-bit system files, just like on 32-bit Windows. (This can be overridden by enabling 64-bit mode.)

{syswow64}
On 64-bit Windows, the system's SysWOW64 directory, typically "C:\WINDOWS\SysWOW64". This is the actual directory in which 32-bit system files reside. On 32-bit Windows, 32-bit system files reside in "System32" or "System", not in a separate SysWOW64 directory, so this constant will resolve to the same directory as {sys} if used there.

Do not use this constant unless you have a specific need to obtain the name of the actual directory in which 32-bit system files reside. Gratuitously using {syswow64} in places where {sys} will suffice may cause problems. (See the documentation for the [Files] section's sharedfile flag for one example.)

{src}
The directory in which the Setup files are located.
For example: If you used {src}\MYPROG.EXE on an entry and the user is installing from "S:\", Setup will translate it to "S:\MYPROG.EXE".

{sd}
System Drive. The drive Windows is installed on, typically "C:". On Windows NT platforms, this directory constant is equivalent to the SystemDrive environment variable.

{pf}
Program Files. The path of the system's Program Files directory. {pf} is equivalent to {pf32} unless the install is running in 64-bit mode, in which case it is equivalent to {pf64}.

{pf32}
32-bit Program Files. The path of the system's 32-bit Program Files directory, typically "C:\Program Files" on 32-bit Windows and "C:\Program Files (x86)" on 64-bit Windows.

{pf64}
64-bit Windows only: 64-bit Program Files. The path of the system's 64-bit Program Files directory, typically "C:\Program Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.

{cf}
Common Files. The path of the system's Common Files directory. {cf} is equivalent to {cf32} unless the install is running in 64-bit mode, in which case it is equivalent to {cf64}.

{cf32}
32-bit Common Files. The path of the system's 32-bit Common Files directory, typically "C:\Program Files\Common Files" on 32-bit Windows and "C:\Program Files (x86)\Common Files" on 64-bit Windows.

{cf64}
64-bit Windows only: 64-bit Common Files. The path of the system's 64-bit Common Files directory, typically "C:\Program Files\Common Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.

{tmp}
Temporary directory used by Setup or Uninstall. This is not the value of the user's TEMP environment variable. It is a subdirectory of the user's temporary directory which is created by Setup or Uninstall at startup (with a name like "C:\WINDOWS\TEMP\IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when Setup or Uninstall exits. During Setup, this is primarily useful for extracting files that are to be executed in the [Run] section but aren't needed after the installation.

{fonts}
Fonts directory. Normally named "FONTS" under the Windows directory.

{dao}
DAO directory. This is equivalent to {cf}\Microsoft Shared\DAO.

{dotnet11}
32-bit .NET Framework version 1.1 root directory.

An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 1.1 present.

{dotnet20}
.NET Framework version 2.0 root directory. {dotnet20} is equivalent to {dotnet2032} unless the install is running in 64-bit mode, in which case it is equivalent to {dotnet2064}.

An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 2.0 present.

{dotnet2032}
32-bit .NET Framework version 2.0 root directory.

An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 2.0 present.

{dotnet2064}
64-bit Windows only: 64-bit .NET Framework version 2.0 root directory.

An exception will be raised if an attempt is made to expand this constant on a system with no .NET Framework version 2.0 present.

Shell Folder Constants
Inno Setup supports another set of directory constants, referred to as shell folder constants. They can be used in the same way as the other directory constants.

"common" below constants refer to the All Users profile.

The "user" constants refer to the profile of the user running Setup. This user is often not the same as the currently logged-in user, so use the "user" constants with caution.

Except where otherwise noted, shell folder constants work on all versions of Windows that Inno Setup supports, including Windows 95 and NT 4.0.

* = The "common" form of this constant is mapped to the "user" form if the logged-in user lacks administrative privileges, or if PrivilegesRequired is set to lowest, or if the operating system is Windows 95/98/Me.

{group}
The path to the Start Menu folder, as selected by the user on Setup's Select Start Menu Folder wizard page. On Windows NT platforms, this folder is created under the All Users profile unless the user installing the application does not have administrative privileges, in which case it is created in the user's profile.

{localappdata}
The path to the local (nonroaming) Application Data folder.

{sendto}
The path to the current user's Send To folder. (There is no common Send To folder.)

{userappdata} & {commonappdata}
The path to the Application Data folder.

{userdesktop} & {commondesktop} *
The path to the desktop folder.

{userdocs} & {commondocs}
The path to the My Documents folder (or on NT 4.0, the Personal folder).

{userfavorites} & {commonfavorites} *
The path to the Favorites folder. Usage of these constants requires a MinVersion setting of at least "4.1, 4". Only Windows 2000 and later supports {commonfavorites}; if used on previous Windows versions, it will translate to the same directory as {userfavorites}.

{userprograms} & {commonprograms} *
The path to the Programs folder on the Start Menu.

{userstartmenu} & {commonstartmenu} *
The path to the top level of the Start Menu.

{userstartup} & {commonstartup} *
The path to the Startup folder on the Start Menu.

{usertemplates} & {commontemplates} *
The path to the Templates folder. Only Windows 2000 and later supports {commontemplates}; if used on previous Windows versions, it will translate to the same directory as {usertemplates}.

Other Constants
{\}
A backslash character. See the note at the top of this page for an explanation of what the difference between using {\} and only a \ is.

{%NAME|DefaultValue}
Embeds the value of an environment variable.

NAME specifies the name of the environment variable to use.
DefaultValue determines the string to embed if the specified variable does not exist on the user's system.
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
NAME and DefaultValue may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Examples:
{%COMSPEC}
{%PROMPT|$P$G}

{cmd}
The full pathname of the system's standard command interpreter. On Windows NT platforms, this is Windows\System32\cmd.exe. On Windows 95/98/Me, this is Windows\COMMAND.COM. Note that the COMSPEC environment variable is not used when expanding this constant.

{computername}
The name of the computer the Setup or Uninstall program is running on (as returned by the GetComputerName function).

{drive:Path}
Extracts and returns the drive letter and colon (e.g. "C:") from the specified path. In the case of a UNC path, it returns the server and share name (e.g. "\\SERVER\SHARE").

Path specifies the path.
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
Path may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Examples:
{drive:{src}}
{drive:c:\path\file}
{drive:\\server\share\path\file}

{groupname}
The name of the folder the user selected on Setup's Select Start Menu Folder wizard page. This differs from {group} in that it is only the name; it does not include a path.

{hwnd}
(Special-purpose) Translates to the window handle of the Setup program's background window.

{wizardhwnd}
(Special-purpose) Translates to the window handle of the Setup wizard window. This handle is set to '0' if the window handle isn't available at the time the translation is done.

{ini:Filename,Section,Key|DefaultValue}
Embeds a value from an .INI file.

Filename specifies the name of the .INI file to read from.
Section specifies the name of the section to read from.
Key specifies the name of the key to read.
DefaultValue determines the string to embed if the specified key does not exist.
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
Filename, Section, and Key may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Example:
{ini:{win}\MyProg.ini,Settings,Path|{pf}\My Program}
{language}
The internal name of the selected language. See the [Languages] section documentation for more information.

{cm:MessageName}
{cm:MessageName,Arguments}
Embeds a custom message value based on the active language.

MessageName specifies the name of custom message to read from. See the [CustomMessages] section documentation for more information.
Arguments optionally specifies a comma separated list of arguments to the message value.
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
Each argument in Arguments may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Example:
{cm:LaunchProgram,Inno Setup}
The example above translates to "Launch Inno Setup" if English is the active language.

{reg:HKxx\SubkeyName,ValueName|DefaultValue}
Embeds a registry value.

HKxx specifies the root key; see the [Registry] section documentation for a list of possible root keys.
SubkeyName specifies the name of the subkey to read from.
ValueName specifies the name of the value to read; leave ValueName blank if you wish to read the "default" value of a key.
DefaultValue determines the string to embed if the specified registry value does not exist, or is not a string type (REG_SZ or REG_EXPAND_SZ).
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
SubkeyName, ValueName, and DefaultValue may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Example:
{reg:HKLM\Software\My Program,Path|{pf}\My Program}
{param:ParamName|DefaultValue}
Embeds a command line parameter value.

ParamName specifies the name of the command line parameter to read from.
DefaultValue determines the string to embed if the specified command line parameter does not exist, or its value could not be determined.
If you wish to include a comma, vertical bar ("|"), or closing brace ("}") inside the constant, you must escape it via "%-encoding." Replace the character with a "%" character, followed by its two-digit hex code. A comma is "%2c", a vertical bar is "%7c", and a closing brace is "%7d". If you want to include an actual "%" character, use "%25".
ParamName and DefaultValue may include constants. Note that you do not need to escape the closing brace of a constant as described above; that is only necessary when the closing brace is used elsewhere.
Example:
{param:Path|{pf}\My Program}
The example above translates to c:\My Program if the command line /Path="c:\My Program" was specified.

{srcexe}
The full pathname of the Setup program file, e.g. "C:\SETUP.EXE".

{uninstallexe}
The full pathname of the uninstall program extracted by Setup, e.g. "C:\Program Files\My Program\unins000.exe". This constant is typically used in an [Icons] section entry for creating an Uninstall icon. It is only valid if Uninstallable is yes (the default setting).

{sysuserinfoname}
{sysuserinfoorg}
The name and organization, respectively, that Windows is registered to. This information is read from the registry.

{userinfoname}
{userinfoorg}
{userinfoserial}
The name, organization and serial number, respectively, that the user entered on the User Information wizard page (which can be enabled via the UserInfoPage directive). Typically, these constants are used in [Registry] or [INI] entries to save their values for later use.

{username}
The name of the user who is running Setup or Uninstall program (as returned by the GetUserName function).

{log}
The log file name, or an empty string if logging is not enabled.

-------
Рекомендую: $25 на тест виртуального сервера (VPS) за регистрацию по ссылке

Это сообщение посчитали полезным следующие участники:

Отправлено: 19:51, 03-04-2010 | #1665


Аватара для Tukash

Пользователь


Сообщения: 109
Благодарности: 5

Профиль | Отправить PM | Цитировать


Habetdin,
еще раз спасибо

Отправлено: 19:54, 03-04-2010 | #1666


Новый участник


Сообщения: 1
Благодарности: 0

Профиль | Отправить PM | Цитировать


Люди помогите соединить 2 скрипта
Код: Выделить весь код
// Importing LoadSkin API from ISSkin.DLL procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall'; // Importing UnloadSkin API from ISSkin.DLL procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall'; // Importing ShowWindow Windows API from User32.DLL function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall'; function InitializeSetup(): Boolean; begin ExtractTemporaryFile('Office2007.cjstyles'); LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), 'NormalBlack.ini'); Result := True; end; procedure DeinitializeSetup(); begin // Hide Window before unloading skin so user does not get // a glimse of an unskinned window before it is closed. ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0); UnloadSkin(); end;
и это
Код: Выделить весь код
procedure InitializeSetup(); begin with WizardForm do begin with MainPanel do Height := Height - 1; with WizardSmallBitmapImage do begin Left := 0; Top := 0; Height := 58; ///Размер рисунка Width := 497; /// end; with PageNameLabel do begin Width := Width - 497; ///Поставьте здесь значения на 0 если хотите вернуть текст Left := Left + 497; /// end; with PageDescriptionLabel do begin Width := Width - 497; ///Поставьте здесь значения на 0 если хотите вернуть текст Left := Left + 497; /// end; end; end;

Отправлено: 00:42, 05-04-2010 | #1667


Ветеран


Сообщения: 1133
Благодарности: 581

Профиль | Отправить PM | Цитировать


Цитата DartVlad:
помогите соединить »
Да, конечно в одну строчку писать, это круто...
читать дальше »

Код: Выделить весь код
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
  external 'LoadSkin@files:isskin.dll stdcall';
// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall';
// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
  external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Office2007.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), 'NormalBlack.ini');
  Result := True;
end;

procedure DeinitializeSetup();
begin
  // Hide Window before unloading skin so user does not get
  // a glimse of an unskinned window before it is closed.
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
end;

procedure InitializeWizard();
begin
  with WizardForm do
    begin
      with MainPanel do
        Height := Height - 1;
      with WizardSmallBitmapImage do
        begin
          Left := 0;
          Top := 0;
          Height := 58; ///Размер рисунка
          Width := 497; ///
        end;
      with PageNameLabel do
        begin
          Width := Width - 497; ///Поставьте здесь значения на 0 если хотите вернуть текст
          Left := Left + 497;   ///
        end;
      with PageDescriptionLabel do
        begin
          Width := Width - 497; ///Поставьте здесь значения на 0 если хотите вернуть текст
          Left := Left + 497;   ///
        end;
    end;
end;

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.

Это сообщение посчитали полезным следующие участники:

Отправлено: 00:27, 06-04-2010 | #1668


Новый участник


Сообщения: 7
Благодарности: 0

Профиль | Отправить PM | Цитировать


Добрый день. Снова есть вопросы к гуру

Задача - сделать новую страницу, на которой будет выпадающий список и картинка ниже.
От выбранного пункта в списке зависит картинка и файлы, которые будут копироваться в папку установки.

Помогите, пожалуйста. Зарание грасиас

Отправлено: 07:58, 06-04-2010 | #1669


Аватара для Winstan

Новый участник


Сообщения: 6
Благодарности: 0

Профиль | Отправить PM | Цитировать


Serega,
Привет. К тебе просьба можешь адаптировать вот Наложение изображений на стандартные кнопки для Картинка на страницах инсталлятора

Отправлено: 16:44, 06-04-2010 | #1670



Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Скрипты Inno Setup. Помощь и советы [часть 3] Serega Автоматическая установка приложений 3755 26-10-2011 17:58
[архив] Inno Setup .:[все вопросы]:. Mchik Автоматическая установка приложений 1329 23-08-2009 20:13
[архив - Часть 2] AutoIt скрипты Vadikan AutoIt 985 21-01-2008 09:58
Скрипты Inno Setup Compiler QAZAK Автоматическая установка приложений 7 15-01-2007 17:59
[Архив - Часть 1.1] AutoIt скрипты EgOrus AutoIt 335 04-02-2006 16:58




 
Переход