pascalscript

Proper structure syntax for Pascal if then begin end and ;

僤鯓⒐⒋嵵緔 提交于 2019-11-26 06:46:29
问题 It has been around 20 years since I last had to write in Pascal. I can\'t seem to use the structure elements of the language correctly where I am nesting if then blocks using begin and end . For example this gets me an Compiler Error \"Identifier Expected\" . procedure InitializeWizard; begin Log(\'Initialize Wizard\'); if IsAdminLoggedOn then begin SetupUserGroup(); SomeOtherProcedure(); else begin (*Identifier Expected*) Log(\'User is not an administrator.\'); msgbox(\'The current user is

Make Inno Setup installer request privileges elevation only when needed

∥☆過路亽.° 提交于 2019-11-26 04:36:22
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 can install the application (to user folder). This has some drawbacks though: Some people use distinct

Inno Setup: copy folder, subfolders and files recursively in Code section

本秂侑毒 提交于 2019-11-26 02:14:01
问题 Is there any way to browse and recursively copy/move all files and subdirectories of a directory within the code section? ( PrepareToInstall ) I need to ignore a specific directory, but using xcopy it ignores all directories /default/ , for example, and I need to ignore a specific only. The Files section is executed at a later time when needed. 回答1: To recursively copy a directory programmatically use: procedure DirectoryCopy(SourcePath, DestPath: string); var FindRec: TFindRec;