📄 scriptfunc.pas
字号:
unit ScriptFunc;
{
Inno Setup
Copyright (C) 1997-2004 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Script support functions
$jrsoftware: issrc/Projects/ScriptFunc.pas,v 1.55 2004/12/22 19:52:44 jr Exp $
}
interface
const
{ ScriptDlg }
ScriptDlgTable: array [0..11] of String =
(
'function PageFromID(const ID: Integer): TWizardPage;',
'function CreateCustomPage(const AfterID: Integer; const ACaption, ADescription: String): TWizardPage;',
'function CreateInputQueryPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputQueryWizardPage;',
'function CreateInputOptionPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; Exclusive, ListBox: Boolean): TInputOptionWizardPage;',
'function CreateInputDirPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; AAppendDir: Boolean; ANewFolderName: String): TInputDirWizardPage;',
'function CreateInputFilePage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputFileWizardPage;',
'function CreateOutputMsgPage(const AfterID: Integer; const ACaption, ADescription, AMsg: String): TOutputMsgWizardPage;',
'function CreateOutputMsgMemoPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption, AMsg: String): TOutputMsgMemoWizardPage;',
'function CreateOutputProgressPage(const ACaption, ADescription: String): TOutputProgressWizardPage;',
'function ScaleX(X: Integer): Integer;',
'function ScaleY(Y: Integer): Integer;',
'function CreateCustomForm: TSetupForm;'
);
{ NewDisk }
NewDiskTable: array [0..1] of String =
(
'function BrowseForFolder(const Prompt: String; var Directory: String; const NewFolderButton: Boolean): Boolean;',
'function GetOpenFileName(const Prompt: String; var FileName: String; const InitialDirectory, Filter, DefaultExtension: String): Boolean;'
);
{ CmnFunc }
CmnFuncTable: array [0..0] of String =
(
'function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;'
);
{ CmnFunc2 }
CmnFunc2Table: array [0..48] of String =
(
'function FileExists(const Name: String): Boolean;',
'function DirExists(const Name: String): Boolean;',
'function FileOrDirExists(const Name: String): Boolean;',
'function GetIniString(const Section, Key, Default, Filename: String): String;',
'function GetIniInt(const Section, Key: String; const Default, Min, Max: Longint; const Filename: String): Longint;',
'function GetIniBool(const Section, Key: String; const Default: Boolean; const Filename: String): Boolean;',
'function IniKeyExists(const Section, Key, Filename: String): Boolean;',
'function IsIniSectionEmpty(const Section, Filename: String): Boolean;',
'function SetIniString(const Section, Key, Value, Filename: String): Boolean;',
'function SetIniInt(const Section, Key: String; const Value: Longint; const Filename: String): Boolean;',
'function SetIniBool(const Section, Key: String; const Value: Boolean; const Filename: String): Boolean;',
'procedure DeleteIniEntry(const Section, Key, Filename: String);',
'procedure DeleteIniSection(const Section, Filename: String);',
'function GetEnv(const EnvVar: String): String;',
'function GetCmdTail: String;',
'function ParamCount: Integer;',
'function ParamStr(Index: Integer): string;',
'function AddBackslash(const S: String): String;',
'function RemoveBackslash(const S: String): String;',
'function RemoveBackslashUnlessRoot(const S: String): String;',
'function AddQuotes(const S: String): String;',
'function RemoveQuotes(const S: String): String;',
'function GetShortName(const LongName: String): String;',
'function GetWinDir: String;',
'function GetSystemDir: String;',
'function GetTempDir: String;',
'procedure StringChange(var S: String; const FromStr, ToStr: String);',
'function UsingWinNT: Boolean;',
'function FileCopy(const ExistingFile, NewFile: String; const FailIfExists: Boolean): Boolean;',
'function ConvertPercentStr(var S: String): Boolean;',
'function RegValueExists(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;',
'function RegQueryStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
'function RegQueryMultiStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
'function RegDeleteKeyIncludingSubkeys(const RootKey: Integer; const SubkeyName: String): Boolean;',
'function RegDeleteKeyIfEmpty(const RootKey: Integer; const SubkeyName: String): Boolean;',
//not really in CmnFunc2
'function RegKeyExists(const RootKey: Integer; const SubKeyName: String): Boolean;',
'function RegDeleteValue(const RootKey: Integer; const SubKeyName, ValueName: String): Boolean;',
'function RegGetSubkeyNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;',
'function RegGetValueNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;',
'function RegQueryDWordValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultDWord: Cardinal): Boolean;',
'function RegQueryBinaryValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;',
'function RegWriteStringValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
'function RegWriteMultiStringValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
'function RegWriteDWordValue(const RootKey: Integer; const SubKeyName, ValueName: String; const Data: Cardinal): Boolean;',
'function RegWriteBinaryValue(const RootKey: Integer; const SubKeyName, ValueName, Data: String): Boolean;',
//
'function IsAdminLoggedOn: Boolean;',
'function IsPowerUserLoggedOn: Boolean;',
'function GetUILanguage: Integer;',
'function AddPeriod(const S: String): String;'
);
{ Install }
InstallTable: array [0..0] of String =
(
'procedure ExtractTemporaryFile(const FileName: String);'
);
{ InstFunc }
InstFuncTable: array [0..19] of String =
(
'function CheckForMutexes(Mutexes: String): Boolean;',
'function DecrementSharedCount(const Filename: String): Boolean;',
'procedure DelayDeleteFile(const Filename: String; const Tries: Integer);',
'function DelTree(const Path: String; const IsDir, DeleteFiles, DeleteSubdirsAlso: Boolean): Boolean;',
'function GenerateUniqueName(Path: String; const Extension: String): String;',
'function GetComputerNameString: String;',
//function GetFileDateTime(const Filename: string; var DateTime: TFileTime): Boolean;
'function GetMD5OfFile(const Filename: String): String;',
'function GetMD5OfString(const S: String): String;',
'function GetSpaceOnDisk(const DriveRoot: String; const InMegabytes: Boolean; var Free, Total: Cardinal): Boolean;',
'function GetUserNameString: String;',
//function GrantPermissionOnFile(const Filename: String; const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
//function GrantPermissionOnKey(const RootKey: HKEY; const Subkey: String; const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
'procedure IncrementSharedCount(const Filename: String; const AlreadyExisted: Boolean);',
'function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;',
'function ShellExec(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;',
'function IsProtectedSystemFile(const Filename: String): Boolean;',
'function MakePendingFileRenameOperationsChecksum: String;',
'function ModifyPifFile(const Filename: String; const CloseOnExit: Boolean): Boolean;',
'procedure RegisterServer(const Filename: String; const FailCriticalErrors: Boolean);',
'function UnregisterServer(const Filename: String; const FailCriticalErrors: Boolean): Boolean;',
'procedure UnregisterFont(const FontName, FontFilename: String);',
//procedure RestartComputer;
'procedure RestartReplace(const TempFile, DestFile: String);'
//procedure Win32ErrorMsg(const FunctionName: String);
);
{ InstFnc2 }
InstFnc2Table: array [0..2] of String =
(
'function CreateShellLink(const Filename, Description, ShortcutTo, Parameters, WorkingDir, IconFilename: String; const IconIndex, ShowCmd: Integer): String;',
'procedure RegisterTypeLibrary(const Filename: String);',
'function UnregisterTypeLibrary(const Filename: String): Boolean;'
);
{ Main }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -