pascalscript

Disassembling strings from Inno Setup [Code]

早过忘川 提交于 2019-12-18 17:07:51
问题 When I compile a Inno Setup project, the [Code] section is also compiled (as Pascal executable or Pascal DLL)? In other words, if someone unpacks a Inno Setup project, can he see the [Code] section as original source code (damn! :) ) or as compiled executable/DLL (difficult to disassemble)? I would like to insert in the [Code] section some strings (password and keys) and I don't know if they would be easily recoverable also with little knowledge of reverse engineering. 回答1: The code is

How can I add a check box for optional files during install in Inno Setup?

ε祈祈猫儿з 提交于 2019-12-18 12:32:29
问题 I'm trying to make a custom checkbox in my custom page (because it's a one page installer), is needed only a checkbox without dialogs or anything, the installer that I'm trying to compile is very linear and simple. I want to bind FILE3.EXE on a checkbox in this way: if checkbox is checked copy the file ( FILE3.EXE ) in DestDir , otherwise if checkbox is unchecked skip the file ( FILE3.EXE ) during installation. This is the code that I used, obviously the checkbox code is missing because I'm

Using global string script variable in Run section in Inno Setup

耗尽温柔 提交于 2019-12-18 07:12:30
问题 I need a global string variable in Inno Setup, that is going to be initialized in [Code] section and used in [Run] section. Is this possible? 回答1: You are probably looking for a scripted constant: [Run] Filename: "{app}\MyProg.exe"; Parameters: "{code:GetGlobalVariable}" [Code] var GlobalVariable: string; function GetGlobalVariable(Param: string): String; begin Result := GlobalVariable; end; function InitializeSetup(): Boolean; begin GlobalVariable := '/parameter'; Result := True; end; For a

Inno Setup - Create User Input Query Page with input length and format limit and use the input

删除回忆录丶 提交于 2019-12-18 05:25:26
问题 So, as the title says, I want to create a User Input Query Page (that's easy), but then I want the field to reject space character(s) and limit the input to no more than 15 characters (a bit more difficult for me). But then I need to write the input to a file, which I'm also not sure how to do. Here's what my code looks like now: var Page: TInputQueryWizardPage; Procedure InitializeWizard(); Begin Page := CreateInputQueryPage(wpSelectTasks, 'Choose a Profile Name', 'This name will be used as

Inno Setup ComponentsList OnClick event

谁都会走 提交于 2019-12-18 05:23:07
问题 I have a list of components for my Inno Setup installer, 19 different options, I want to set the OnClick event for ONE of the components. Is there a way to do this? Or is there a way to check which component triggered the OnClick event if it's set for all components? Currently, the OnClick event is set like so: Wizardform.ComponentsList.OnClick := @CheckChange; I would like to do something like: Wizardform.ComponentsList.Items[x].OnClick := @DbCheckChange; The WizardForm.ComponentList is

Inno Setup: List all file names in an directory

余生长醉 提交于 2019-12-18 05:04:12
问题 Am trying to list all files with names in an directory, but unable to do. Is there any way to list all files with names in an directory? Thanks in advance. 回答1: The following script shows how to list all files of a specified directory into a TStrings collection (in this example listed in the list box on a custom page): [Code] procedure ListFiles(const Directory: string; Files: TStrings); var FindRec: TFindRec; begin Files.Clear; if FindFirst(ExpandConstant(Directory + '*'), FindRec) then try

Make Inno Setup WizardForm moveable if titlebar is disabled

血红的双手。 提交于 2019-12-18 04:23:17
问题 I want to make an installer with a custom look and disabled the titlebar by setting the BorderStyle to bsNone . Now I cannot move the window anymore. I have looked around and found a solution for Delphi: http://www.chami.com/tips/delphi/010397D.html Can this be accomplished in Inno Setup? I have already looked up the WM_NCHITTEST thing on MSDN but I cannot figure out if and how I can make this work. Edit: After looking around and compiling it using the advanced compiler advanced compiler I

Replace a text in a file with Inno Setup

天大地大妈咪最大 提交于 2019-12-17 18:31:31
问题 Hi I have a problem with replacing a text in a textfile with Inno Setup (Delphi based). My Code: procedure FileReplaceString(const FileName, searchstring, replacestring: string); var fs: TFileStream; S: string; begin fs := TFileStream.Create(FileName, fmOpenread or fmShareDenyNone); try SetLength(S, fs.Size); fs.ReadBuffer(S[1], fs.Size); finally fs.Free; end; { the compiler stops here with: unknown identifier 'StringReplace' } S := StringReplace(S, SearchString, replaceString, [rfReplaceAll,

How to check if port is usable in Inno Setup?

霸气de小男生 提交于 2019-12-17 16:32:19
问题 I need to check some port is usable or not? How can do that in Inno Setup? Is there any way to use socket in to Inno Setup? Is there any library for this? If there how can import it and use it? Thank you for your answers. 回答1: You can use my function to check, if a port is available: function CheckPortOccupied(Port:String):Boolean; var ResultCode: Integer; begin Exec(ExpandConstant('{cmd}'), '/C netstat -na | findstr'+' /C:":'+Port+' "', '', 0, ewWaitUntilTerminated, ResultCode); if

Make Inno Setup installer request privileges elevation only when needed

老子叫甜甜 提交于 2019-12-17 00:12:59
问题 Inno Setup installer has the PrivilegesRequired directive that can be used to control, if privileges elevation is required, when installer is starting. I want my installer to work even for non-admin users (no problem about installing my app to user folder, instead of the Program Files ). So I set the PrivilegesRequired to none (undocumented value). This makes UAC prompt popup for admin users only, so they can install even to the Program Files . No UAC prompt for non-admin users, so even them