pascalscript

LoadStringFromFile and StringChangeEx from Unicode Inno Setup (Ansi file)

跟風遠走 提交于 2019-11-30 16:42:45
问题 I'm trying to update one of my scripts to use the Unicode version of Inno Setup. Unfortunately I'm running into a problem where StringChangeEx is expecting to see a unicode String instead of the AnsiString that I need (mismatched type). Is there an alternate way to replace matching AnsiStrings from Unicode Inno Setup? I'm using WizardDirValue() to avoid having to type ExpandConstant('{app}\') all the time, in case anyone wonders why. var AnsiData: AnsiString; begin LoadStringFromFile

How to Delay without freezing - Inno Setup

做~自己de王妃 提交于 2019-11-30 16:39:07
Hello I like to know how can I delay a work (or a command) for a specified time in Inno Setup Pascal Script. The built in Sleep(const Milliseconds: LongInt) freezes all work while sleeping. And the following function I implemented also makes the WizardForm unresponsive but not freezing like built in Sleep() Function. procedure SleepEx(const MilliSeconds: LongInt); begin ShellExec('Open', 'Timeout.exe', '/T ' + IntToStr(MilliSeconds div 1000), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode); end; I also read this , but can't think how to use it in my Function. I like to know how can I use

How to get Inno Setup to unzip a single file?

别来无恙 提交于 2019-11-30 16:25:13
Is there a way to unzip just one file from a zip? I'm using code based on response for How to get Inno Setup to unzip a file it installed (all as part of the one installation process) , works perfect for unzip but don't have an idea how can it unzip a single file: [Code]: const NO_PROGRESS_BOX = 4; RESPOND_YES_TO_ALL = 16; procedure UnZip(ZipPath, TargetPath: string); var Shell: Variant; ZipFile: Variant; TargetFolder: Variant; begin Shell := CreateOleObject('Shell.Application'); ZipFile := Shell.NameSpace(ZipPath); if VarIsClear(ZipFile) then RaiseException(Format('ZIP file "%s" does not

Image covering whole page in Inno Setup

*爱你&永不变心* 提交于 2019-11-30 16:19:58
Following on from this: Inno Setup Placing image/control on custom page . This is doing what I need: CustomPage := CreateCustomPage(wpLicense, 'Heading', 'Sub heading.'); ExtractTemporaryFile('image.bmp'); BtnImage := TBitmapImage.Create(WizardForm); with BtnImage do begin Parent := CustomPage.Surface; Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\image.bmp'); AutoSize := True; AutoSize := False; Height := ScaleX(Height); Width := ScaleY(Width); Stretch := True; Left := ScaleX(90); Top := WizardForm.SelectTasksPage.Top + WizardForm.SelectTasksPage.Height - Height - ScaleY(8); Cursor := crHand;

How to disable NextButton when file is not selected on InputFilePage (CreateInputFilePage)?

为君一笑 提交于 2019-11-30 16:19:45
问题 My Inno Setup program have a custom "input file page" that was created using CreateInputFilePage . How can I disable the NextButton in this page until the file path is properly picked by the user? In other words, I need to make the NextButton unclickable while the file selection form is empty, and clickable when the file selection form is filled. Thank you. 回答1: The easiest way is to use NextButtonClick to validate the inputs and display an error message when the validation fails. var

How to Delay without freezing - Inno Setup

荒凉一梦 提交于 2019-11-30 16:18:33
问题 Hello I like to know how can I delay a work (or a command) for a specified time in Inno Setup Pascal Script. The built in Sleep(const Milliseconds: LongInt) freezes all work while sleeping. And the following function I implemented also makes the WizardForm unresponsive but not freezing like built in Sleep() Function. procedure SleepEx(const MilliSeconds: LongInt); begin ShellExec('Open', 'Timeout.exe', '/T ' + IntToStr(MilliSeconds div 1000), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);

Disassembling strings from Inno Setup [Code]

老子叫甜甜 提交于 2019-11-30 15:12:54
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. The code is compiled into some kind of a binary representation (very roughly like .NET CIL or Java bytecode ). There's Inno

Inno Setup WizardImageFile looks bad with font scaling on Windows 7

…衆ロ難τιáo~ 提交于 2019-11-30 10:31:25
Bitmap for Inno Setup WizardImageFile (and WizardSmallImageFile ) looks terrible because when Windows 7 has the large system fonts enabled, the Wizard is bigger than usual, but the images are scaled terrible wrong. Is there a fix? There is no similar issue if I add own picture somewhere like this: BitmapImage1.AutoSize := True; BitmapImage1.Align := alClient; BitmapImage1.Left := 0; BitmapImage1.Top := 0; BitmapImage1.stretch := True; BitmapImage1.Parent := Splash; These are bitmap images, they naturally scale badly. You are just lucky that your own images do not look that bad when scaled. You

Inno Setup doesn't allow access to all registry keys, why?

[亡魂溺海] 提交于 2019-11-30 07:55:03
问题 I use this code to know if a key exists or not: if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Autodesk') then begin MsgBox('Key exists!!', mbInformation, MB_OK); end; for this example, it works, I have the message box, but with this it doesn't: if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Autodesk\Maya') then begin MsgBox('Key exists!!', mbInformation, MB_OK); end; But the Maya key exists on my computer. Can anybody help me? EDIT : In fact, it seems that Inno Setup don't access to the right

Inno Setup custom dialog with per user or per machine installation

三世轮回 提交于 2019-11-30 07:38:25
I'm using Inno Setup ( http://www.jrsoftware.org/isinfo.php ) to create native bundle for my JavaFX application. I'd like to create a custom step where ask the user if want a "per user" or "per machine" installation in order to permit both the unprivileged user, and the administrator to install the software. It's this possible with Inno Setup? And if yes can you provide a trace to follow? Take a look at this screenshot Inno Setup 6 Inno Setup 6 has a built-in support for non-administrative install mode . Basically, you can simply set PrivilegesRequiredOverridesAllowed : [Setup]