Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Nullsoft Scriptable Install System | NSIS

Модерирует : gyra, Maz

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

Victor_VG



Tracker Mod
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
  **************************************************************
   * ProcLib - process management tools library for NSIS v2.xx  *
   **************************************************************
 
 This library writing is VictorVG @ VikSoft.Ru, Russia, Moscow.
 Writes is 12:20 02 Mar 2006, updated to v2.6 at 06 May 2010 at 09:55
---------------------------------------------------------------------
 
Required:
 
Before use ProcLib please, insert command into header in to Your script:
 
!include "ProcLib.nsh"
 
NOTES:
 
Before use ProcLib.nsh in to Your project script, Your mast always
remove directive !include "nsProcess.nsh" then this directive already
included on "ProcLib.nsh" for prevent compilation stop and generation
"Duplicate !include "nsProcess.nsh"." error messages.
 
In to ProcLib.nsh v.2.0 added standard template for write user factions.
 
ProcLib.nsh provided is flowing macros and functions:
 
Old functions:
==============
 
SIDtU, SIDtG, SIDtI, SIDtS
--------------------------
 
Standard installer running detector:
 
 SIDtU - is standart installer running filter-detector for use on Update.
 SIDtG - is standart installer running filter-detector for use on Upgrade.
 SIDtI - is standart installer running filter-detector for use on Setup.
 SIDtS - is standart installer running filter-detector for use on Install.
 
All this macro returned status
code on register $R1 if checked process is:
 
   not running - 0
   running - 1
 
Usage:
 
    ${SIDtU} or ${SetDetU} or ${SIDtG} or ${SetDetG} or ${SIDtI}
        or ${SetDetI} or ${SIDtS} or ${SetDetS}
 
NOTES:
 
If this macro use in .onInit function, then this macros mast write in
to starting block on this function!
 
This macros can use .onInit function or main program.
 
TermProc
--------
 
This macros is find selected process and kill it if running. Macros
display system error code is use standart messages box and terminated
install procedure:
 
 601 No permission to terminate process
 602 Not all processes terminated successfully
 604 Unable to identify system type
 605 Unsupported OS
 606 Unable to load NTDLL.DLL
 607 Unable to get procedure address from NTDLL.DLL
 608 NtQuerySystemInformation failed
 609 Unable to load KERNEL32.DLL
 610 Unable to get procedure address from KERNEL32.DLL
 611 CreateToolhelp32Snapshot failed
 
If macro is the display a system error code you owe:
 
 601 - Please, contact Your system administrator - Your don't have
    right for terminate this process;
 602 - Please, use Task Manager or equivalents tool for handled
    terminate all running copy on this process and restart Setup.
 on 604 up to 611 - Please, contact Your system administrator or
    operating system engineer for correct this system error.
 
Usage: ${TermProc} _PROCNAME _TXTFILE
 
Parameters:
 
  _PROCNAME full process name include extensions
  _TXTFILE full diagnostics messages list file name include extensions
 
 
This macros can use .onInit function or main program.
 
TrmPrc
------
 
This macros is find indicated process and kill it if running. If
needed, macros output error messages on display use ErrDcd function.
This macro required only one parameter: "_PRCNM" - full process
executable file name include extensions. Messages languages is only
English and Russian.
 
NOTES:
 
If Your use ${SetDet} function at .onInit/.unInit function, I recommended
write this function in to starting block on .onInit/.unInit function!
 
Usage: ${TrmPrc} _PRCNM,
 
Parameter:  
 
 _PRCNM - process executable name include extension.
 
This macros can use .onInit function or main program.
 
ErrDec
------
 
${ErrDec} is function for nsProcess error code decode and user alarm.
If Error Code detected this function generated user alarm and
terminated terminated current installation.
 
Usage: ${ErrDec} _var
   
Parameters:
 
 _var - input variable contaned analasing code.
 
This function can use .onInit/.unInit function or main program.
 
PrDet
-----
 
Function ${PrDet}. Detector if checked process is ruining.
 
Usage: ${PrDet} _ProcName _ReturnCode
 
Parameters:
 
 _ProcName - full process name include extension
 _ReturnCode - is "0" if process not running or "1" if process running
               or Error Code if detected any system error.
 
All Error Code equivalents ${nsProcess:FindProcess} error code list.
 
 
RplSet
------
 
This function is replace value in saved .REG-file using existing Registry value.
If function is detected error, then Error flags is set On, and returned error code.
 
Usage: ${RplSet} KEY _SKEY _VALUE _REGFI _REGFO _STR _ERR
 
Parameters:
 
 _KEY HKCU|HKLM|HKCR... - root Registry key for find setting
 _SKEY subkey for find setting
 _VALUE value for find setting
 _REGFI - input .REG-file
 _REGFO - output .REG-file
 _STR - replaced string value
 _ERR - variable for output error
 
Examples:
 
  ${RplSet} HKCU "Software\Mysoft\ModuleDir\MyModule" "Value" "$INSTDIR\configdir\default.reg" \
   "$INSTDIR\configdir\default.reg" "C:\\Program Files\\MyPogram\\SubDir\\ModuleDir\\Module.exe" $1
 
  or
 
  ${RplSet} HKLM "Software\MyProg" "InstallDir" "$INSTDIR\configdir\default.reg" \
 "$INSTDIR\configdir\default.reg" "C:\\Program Files\\MyProgram" $1
 
 
MinVer
------
 
This function is simply detected OS version, compared to _mimver and returned "1"  
if OS version eqvalents or highest then requiremens, or "0" if letter in to users  
variables _retn
 
Usage: ${MinVer} _minver _retn
 
Parameters:
 
 _minver - minimal version, two digits, example 51
 _retn - user variables for returned results, exclude registers $R0 - $R2
 
Rescriptions:
 
Your can't use register $R0 - $R2 as _retn variables
 
Examples:
 
; added on to script header:
 
...
!include "ProcLib.nsh"
var s1
...
 
Section "Code"
     ...
     ${MinVer} 51 $s1
     ...
SectionEnd
 
RngVer
------
 
This functions gets the operating system version and service pack number,
checks whether it is in the range _minver and _maxver, and if the version
of the system with installed service pack number, located in the specified
range, it returns "1" in the variable _retn, in other cases it returns "0".
 
Usage: ${RngVer} _minver _maxver _retn
 
Parameters:
 
 _minver - min version and service pack number, always free digits, example 510
 _minver - max version and service pack number, always free digits, example 513
 _retn - user variables for returned results, exclude registers $0 and $1
 
Notes: if any digits not existing You mast replace this symbol use "0" digit.
 
Rescriptions:
 
Your can't use register $0 - $1 as _retn variables
 
Examples:
 
var s1
 
...
 
${RngVer} 501 513 $s1
 
; added on to script header:
 
...
!include "ProcLib.nsh"
var s1
...
 
Section "Code"
     ...
     ${RngVer} 500 619 $s1
     ...
SectionEnd
 
Detect OS version and service pack number then check that OS is Windows 2000 or
Windows XP/2003, or Windows Vista/2008, or Windows 7/2008 R2 and return "1" if
true. Else this function returned "0" if comparison is failure.
 
PrcReg
------
 
This function detected and terminate any process use path saved in to Registry.
 
Usage: ${PrcFndReg} _rkey1 _key1 _value1 _rkey2 _key2 _value2 _ofset _mode _retn
 
Parameters:
 
 _rkey1 - Registry root key to checked programm full path
 _key1 - Registry key to checked programm full path
 _value1 - Registry value to checked programm full path
 _rkey2 - Registry root key to checked programm path
 _key2 - Registry key to checked programm path
 _value2 - Registry value to checked programm path
 _ofset - additional ofset if needed, if ofset can't needed mast be is 0
 _mode - calling mode: if T - find and terminate process, else - only find
 _retn - process detect code: if process currenly running is "running", else is "success"
 
 Rescriptions:
 
 Thsis macros used and restored registers $0, $1, $2, $3 and Your cann't use it as parameters.
 
 Examples:
 
 PrcFndReg HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" \
           "DisplayIcon" HKLM \
           "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1" \
           "InstallLocation" 0 $4
 
WriteEnvStr
-----------
 
This function detected existing enveronment variables and appen it or create new enveronment
variables record if needed.
 
Usage: ${WriteEnvStr} _HKR _Key _ValueName _Value _Sep
 
Parameters:
 
 _HKR - Registry root key for variable
 _Key - Registry key for variable
 _ValueName - Registry value for variable
 _Value - variable value
 _Sep - value separator. If _Sep not used, then _Sep mast be defined as "".
 
 Examples:
 
 WrtEnvStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" \
         "CYGWIN" "nodosfilewarning" " " $R0

Всего записей: 33266 | Зарегистр. 31-07-2002 | Отправлено: 13:12 29-05-2010 | Исправлено: Victor_VG, 13:18 29-05-2010
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Nullsoft Scriptable Install System | NSIS


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru