pascalscript

Inno Setup Change AppName based on component(s) selected

夙愿已清 提交于 2019-12-01 01:20:10
I need the installer to show different AppName based on (un)selected components. I tried this: [Setup] AppName={code:GetAppName} AppVersion=1.0 AppVerName=Dagon Video Tools AppId=Dagon Video Tools DefaultDirName={sd}\Games\Dagon Video Tools [Code] function GetAppName(Value: string): string; var CurPageID: Integer; Begin Result := 'Dagon Video Tools' if (CurPageID=wpSelectComponents) and IsComponentSelected('Slasher') and not IsComponentSelected('Frankenstein') then begin Result := 'Dagon Slasher'; end; if (CurPageID=wpSelectComponents) and IsComponentSelected('Frankenstein') and not

My SQL server discovery on LAN by listening port (Inno Setup)

与世无争的帅哥 提交于 2019-12-01 00:53:34
I need to search for an IP address with Listening Port to look up for others PC on LAN (try to discovery MySQL server) and get the results IP who has that port listening. Something similar to this code to test sockets but working in Inno Setup: program pfinger; uses sockets,errors; Var Addr : TInetSockAddr; S : Longint; Sin,Sout : Text; Line : string; begin Addr.sin_family:=AF_INET; { port 79 in network order } Addr.sin_port:=79 shl 8; { localhost : 127.0.0.1 in network order } Addr.sin_addr.s_addr:=((1 shl 24) or 127); S:=fpSocket(AF_INET,SOCK_STREAM,0); If Not Connect (S,ADDR,SIN,SOUT) Then

Inno Setup shorten file path string to fit FilenameLabel

本秂侑毒 提交于 2019-12-01 00:45:46
On the WizardForm.InstallingPage , the WizardForm.FilenameLabel automatically truncates the string containing the file path, to include the drive letter at the beginning, followed by the maximum displayable path, truncating from the top level of the path, to fit the size of the label, so that the file name is always shown e.g. C:\...\LongFilePathNameWithMultipleSubDirectories\Filename.ext . I have looked at the Length , Pos , Copy and ExtractFileDrive String Functions, but given that there are an almost infinite number path and file name possibilities, as the user can choose any installation

Adding nodes to xml with DOM in inno Setup - strange problems

别来无恙 提交于 2019-12-01 00:26:33
Very strange problem: I use the DOM to edit an xml file (a .exe.config file for an app that needs to interact with ours), but seeing as I have to bulk-add several similar sections, I made a function to insert the whole needed block. Calling this function once works perfectly. Calling it again with different parameters just afterwards gives an exception (see explanation below the code). The code: // Split a string into an array using passed delimeter procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String); var i: Integer; begin i := 0; repeat SetArrayLength(Dest, i+1); if

Inno Setup Pascal Script to search for running process

笑着哭i 提交于 2019-11-30 22:13:15
I am currently trying to do a validation at the uninstall moment. In a Pascal script function, in Inno Setup, I want to search for a specific processes, with a wild card if possible. Then, loop through all find results, get the Image Name and Image Path Name, in order to check if the program that is about to be uninstalled is the same as the one running. Is there a way to do that? TLama This is an exemplary task for WMI and its WQL language. Getting list of running processes through WMI is even more reliable than Windows API. The below example shows how to query the Win32_Process class with

Adding nodes to xml with DOM in inno Setup - strange problems

痞子三分冷 提交于 2019-11-30 19:09:10
问题 Very strange problem: I use the DOM to edit an xml file (a .exe.config file for an app that needs to interact with ours), but seeing as I have to bulk-add several similar sections, I made a function to insert the whole needed block. Calling this function once works perfectly. Calling it again with different parameters just afterwards gives an exception (see explanation below the code). The code: // Split a string into an array using passed delimeter procedure Explode(var Dest: TArrayOfString;

How to show a hyperlink in Inno Setup?

柔情痞子 提交于 2019-11-30 18:05:20
I'm making a validation in my Inno Setup installer to check whether or not a Microsoft update is installed on the machine, if not, I'm showing a simple message box telling the user that the update is required, this is the message code: MsgBox( 'Your system requires an update supplied by Microsoft. ' + 'Please follow this link to install it: ' + 'http://www.microsoft.com/downloads/details.aspx?FamilyID=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en', mbInformation, MB_OK); I want to make the URL an hyperlink to the web page, but I haven't been able to figure it out how, it is possible in

LoadStringFromFile and StringChangeEx from Unicode Inno Setup (Ansi file)

风格不统一 提交于 2019-11-30 17:37:25
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(WizardDirValue() + '\legacyansi.conf', AnsiData) { Type mismatch, StringChangeEx expects String which is

Inno Setup Pascal Script to search for running process

╄→尐↘猪︶ㄣ 提交于 2019-11-30 17:29:48
问题 I am currently trying to do a validation at the uninstall moment. In a Pascal script function, in Inno Setup, I want to search for a specific processes, with a wild card if possible. Then, loop through all find results, get the Image Name and Image Path Name, in order to check if the program that is about to be uninstalled is the same as the one running. Is there a way to do that? 回答1: This is an exemplary task for WMI and its WQL language. Getting list of running processes through WMI is

Verify permissions to run Inno Setup installer online

社会主义新天地 提交于 2019-11-30 17:03:55
I am looking for a code for Inno Setup, that I can use to make my setup verify my permission to install the program. This code must check a text file on a web server. If the file has the value "False", the setup has to cancel an installation and save the value in a registry file to cancel the it always when Internet connection is not available. If the file has the value "True", the setup will continue to install, and it will delete the registry file value if it exists. If there is no Internet and the registry value does not exist the setup will continue to install. Use InitializeSetup event