How can I increase the width of a msgbox() in inno setup - inno-setup

Or should have to create my own message box? If so any sample code please
Ok, so it is not possible. I will have to do my own msgbox function.
Should I use a TForm, Tmemo or Tpannel?
How can I have the box hight auto adjustable?
If any one has some sample code I could just start with, I would appreciate.
Thanks

You cannot increase width of message box in Inno Setup.
You have to implement your own dialog.
Start with creating TForm (preferably using CreateCustomForm function), add TLabel to it along with few TButton's. Size all elements properly. At the end call TForm.ShowModal.
The code required is far too long to be asked for here. If you have specific problems, when implementing it, ask separate questions.
See few examples of building a custom form:
Custom Uninstall page (not MsgBox)
How can I show a "please wait" window while checking for prerequisites in my installer?
Displaying text from a file in an Inno installer with new lines

Related

Inno Setup - How can I change the About dialog text?

Can I change the default text in the about dialog box? Overriding the AboutSetupMessage doesn't seem to do anything:
[Messages]
AboutSetupMenuItem=&About MyApp...
AboutSetupTitle=About MyApp
AboutSetupMessage={#MyAppPublisher} version {#MyAppVersion}%n{#MyCopyright}%nhome page:%n{#MyAppURL}
Doesn't seem to matter if I edit the default.isl or use a custom ISL either. The menu item and the title change, but not the message text.
Any ideas?
There's no AboutSetupMessage.
There's AboutSetupNote. It does not change the About box message though. It's appended to it.
There's no way to change the message.
For me the AboutSetupNote did not work on Inno Setup 5.6.1 Unicode, but the TranslatorNote did.
Alternatively try TranslatorNote. This one does not change the about box message but it will append to it which is the correct application of Inno Setup license.

applescript display dialog with custom icon

Is there a way to use custom icons with applescript display dialog and notifications?
In the AppleScript documentation it says about the display dialog:
with icon (text | integer)
The resource name or ID of the icon to
display.
with icon (stop | note | caution) The type of icon to show.
You may specify one of the following constants:
stop (or 0): Shows a stop icon
note (or 1): Shows the application icon
caution (or 2): Shows a warning icon, badged with the application icon
with icon (alias | file) An alias or file specifier that specifies a .icns file.
So it seams like you can use your own icons, but I cannot get the following code to work.
display dialog "Text" with icon "/Users/user/Desktop/asd.icns"
It gets me the following error: "Resource not found."
The goal is to not even use a display dialog, but a display notification instead.
First of all you can't display a custom icon with display notification. The reason is that notifications are strongly related to a target application. As AppleScript scripts and applets aren't applications in terms of the Notification framework, the notification is related to the current application, the AppleScript Runner.
But you can display a custom icon with display dialog
The line
with icon (alias | file) An alias or file specifier that specifies a .icns file.
means what it says: The parameter must be an alias or file specifier rather than a POSIX or HFS string path.
Either
display dialog "Text" with icon alias ((path to desktop as text) & "asd.icns")
or
display dialog "Text" with icon file ((path to desktop as text) & "asd.icns")
path to desktop as text represents the HFS path to the desktop of the current user:
"Macintosh HD:Users:user:Desktop:"
Noted this question was three years ago, but I stumbled across this looking for a solution to a similar problem. Mine needs display alert rather than ... notification but the problem is the same because display alert doesn't have a custom icon option.
As noted in the other answer here, AppleScript has at least three interactive message type commands: display dialog, display alert, display notification, and probably others. It seems odd that only the first has the option to add a custom icon. I don't really understand why that is when it would be simple to make them consistent.
Needless to say, this question and #vadian's answer, inspired my solution - a "duh" moment for me once I realized it. It may or may not be a solution to this question. Posting it in case it is...
If the icon in question belongs to an app, you can tell that app to display the notification, regardless of whatever else your script is doing.
Your script can do whatever it needs to do to whatever other apps, or System Events, or itself (if your script is saved as its own application), or whatever else. In the middle of all of that you can have a single line that says:
tell application "MyApp" to display notification ...
The notification will have My App's icon, the result of the notification if any will be returned to the rest of the script and then your script will continue on inside whatever other tell statement or context its in.
If your icon isn't the icon for an app, then I believe there are ways to create an empty app with whatever icon you like, which can behave this way. Admittedly that's a bit of a kludge, but depending on how badly you want this, it's an option - though not one I'll expand on here.
My specific case in detail if interested (but doesn't particularly add to the solution above, just covers how I got there):
I'm writing a script that quits and re-opens another application after confirmation from the user. However, let's say I just wanted to provide a notification as per this question.
Options:
1. display dialog - has the option to provide a custom icon but lacks features of the other two options.
2. display alert - no custom icon but has other desired features, in my case the message parameter which adds extra smaller explanatory text below the primary text.
3. display notification - no custom icon but has other features as desired by this question's poster.
In my case I want alert because I want that extra message parameter (but this works for notification as well).
In my case, ideally the icon of the alert would be the icon of the app I'm restarting, but I can't tell the app itself to display the alert and then restart because the script loses connection with the app when it quits and it kills the running of the script.
If I tell System Events or the script itself to do all that then it can quit and reopen the app independently of the app, but the alert has the generic icon of itself or the System Events icon.
However, if I do what I described above - have my script do all its stuff, but have it tell the app in question to display the alert (and only that as described above), then the alert has the icon of the app in question, but the script still does its stuff independently of the app outside of that alert.
Solved my problem. May or may not solve this question.
#DavidT's answer is a perfect solution when your script is controlled by another application. However, things have changed a bit on Mac OS since.
Notably, if you run your script with tell application "MyApp" to display alert ... you will be promoting the user to give your app permissions to control itself, at least starting since Catalina. Not only this annoys the user with a new permission request, but it also looks kinda dumb since the dialogue is asking the user to allow "MyApp" to control "MyApp" and if the user denies it, your script will fail.
To avoid the permission request, just use tell me to display alert ... this will work just fine.
Another issue you might run into is that osascript may throw an exception if your script is launched as root. I found a nice workaround for that here.
This is a small example of how to launch the dialogue with the right user:
uid=determineUserIdFunction(...)
launchctl asuser $uid /usr/bin/osascript <<-EOS
tell me to display dialog "Now you see me" buttons {"OK"} default button 1 with title "WARNING!"
EOS
You have your path specification wrong. If you have a posix path to your icns file, use the POSIX file class coercion:
display dialog "Text" with icon POSIX file "/Users/user/Desktop/asd.icns"
This coerces the string path into a file reference the system understands, and works just fine.

Inno Setup: Color for modal and browse directory windows

Is it possible to change inner background color for modal and browse directory windows in Inno Setup? In my case I want it should be white.
UPD: Same behaviour is on the inner pages of Inner Setup, but I've fixed it by setting WizardForm.InnerPage.Color := clWhite;
I'm using VclStylesInno for styling my installer with custom style spreadsheat.
You cannot change the color of these in Inno Setup itself, except by a custom build of Inno Setup or some addon DLL (see below).
All you can do is to re-implement these dialogs from the scratch:
For the "browse" dialog: Handle the WizardForm.DirBrowseButton.OnClick and use CreateCustomForm and TFolderTreeView to implement the browse dialog. Download Inno Setup code and copy the existing implementation from SelFolderForm.pas.
For an example of handling WizardForm.DirBrowseButton.OnClick, see
How to display localized Program Files name (display name) during installation?
For the "cancel" dialog: Implement the CancelButtonClick event function. Make sure you set Confirm to False to get rid of the default prompt. And implement your own. Again, use the CreateCustomForm.
It's a lot of work for a small gain. I'd not do it.
Instead, you can use VCL Styles for Inno Setup (DLL) to style Inno Setup windows (including all modal dialogs).
As turned out, the reason was in the "Colors" option in Bitmap Designer, which I use to modify my installer style. This option makes some additional styling for controls:

How to skip the screen for Name/Organization in Inno Script installer

Inno Setup allows you to see a screen in which you are prompted to input your name and Organization.
How I can make my installer skip this screen?
To skip the Name and Organization input in InnoSetup script do the following:
UserInfoPage=no
Source: http://www.jrsoftware.org/ishelp/index.php?topic=setup_userinfopage
For that page to appear, your setup must have explicitly implemented the CheckSerial event function. If you remove that then the page will also disappear.

How to add a progress bar so the user doesn't hit Cancel in a dialog?

I'm working with Installshield 2011 on a basic MSI project.
The problem I have is that the SetupInitialization dialog is taking about 2 to 3 minutes when performing upgrades. During those minutes the users only see:
Computing space requirements
And nothing seems to be happening.
I'd like to add some kind of progress bar so they become aware that something is happening and that they shouldn't hit cancel (We've documented that this steps takes a while, but of course everybody reads the documentation, right?)
I've tried adding an animated GIF file with some kind of progress bar, but seems like GIF files are not permitted in dialogs.
Now I'm exploring the Progress Bar control, but I'm not sure this is the right way to go.
Does anybody know how can I achieve what I need?
Thanks,
Unfortunately this is not supported by MSI packages.
Do you have custom actions in InstallUISequence? If you do, make sure that you set an Action Text for them. The initialization dialog should display the action text for all InstallUISequence actions executed before the first modal installation dialog.
If you don't have custom actions, but you have a very large installer, you have limited options.
A solution would be an external UI which can display an indeterminate progress. For example a HTML control. Not sure if InstallShield supports a custom progress bar in HTML, but you can try.

Resources