How to delete or disable Organization box from UserInfoPage? - inno-setup

Well, as the question says, is there any way to delete or disable organization box?
Here a screenshot:

You can hide both Label and Edit box with CurPageChanged procedure in [Code] section.
[Code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpUserInfo then begin
WizardForm.UserInfoOrgLabel.Hide();
WizardForm.UserInfoOrgEdit.Hide();
end;
end;

Related

Inno Setup customize FinishedLabel with Pascal Script

My goal with Inno Setup 6.x is to customize the FinishedLabel text in code, i.e., Pascal Script. The reason why I'm using Pascal Script is that I want to only customize/change the label if IsAdminMode() is true. How can I do that?
The following two approaches do not work:
Use a scripted constant:
[Messages]
FinishedLabel={code:GetFinishedLabel}
[Code]
function GetFinishedLabel(Param: String): String;
begin
Result := 'BLA';
end;
This shows "{code:GetFinishedLabel}" rather than "BLA".
Customize the wizard in InitializeWizard.
Complete (failing) example:
[Code]
procedure InitializeWizard();
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
The FinishLabel still shows the original text from Default.isl
Any ideas?
The FinishedLabel is updated at the end of the installation according to various factors. So your value set in InitializeWizard is overridden. You have to set your custom message later, such as in CurPageChanged(wpFinished):
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
end;
You might consider to improve the code to do what Inno Setup would do, like:
Taking into account, if restart is needed (FinishedRestartLabel);
Taking into account, if icons were created (FinishedLabel vs. FinishedLabelNoIcons);
Adjusting the label height to fit the message;
Shifting RunList position according to the message height.

Semi-Transparent Wizard Form

I was working on an Inno Setup design when I faced this mighty question in front of me...How to make the Wizard form semi-transparent?
I know Delphi too so I'm thinking if there is any way we can use FMX's Fill.Color and transparency=true with Inno Setup?
I'm currently using this function for Wizard creation:
procedure CreateWizardForm;
begin
with WizardForm do begin
BorderStyle:=bsNone;
ClientWidth:=900;
ClientHeight:=540;
InnerNotebook.Hide;
OuterNotebook.Hide;
Center;
Bevel.Hide;
NextButton.Width:=0;
CancelButton.Width:=0;
end;
Form:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}')+'\form.png',0,0,900,540,True,True);
end;
Regards
Ramiro
There is Inno Setup plug-in as for NSIS called IsWin7 or MegaFileUpload.
It works for Windows Vista and Windows 7 - both systems support Aero effects.
Keep in mind that iswin7.dll is non-official.
Sample:
[Files]
Source: ".\ISWin7.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
[Code]
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);
external 'iswin7_add_glass#files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);
external 'iswin7_add_button#files:iswin7.dll stdcall';
procedure iswin7_free;
external 'iswin7_free#files:iswin7.dll stdcall';
procedure InitializeWizard();
begin
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, ScaleY(47), True);
end;
procedure DeinitializeSetup();
begin
iswin7_free;
end;
Is the feature you are trying to achieve called Aero (from Windows Vista)?
I think this is not possible to do in pure Inno Setup.
Check this NSIS plug-in: http://nsis.sourceforge.net/Aero_plug-in.
It is open source and uses some Windows API functions -- for inspiration.

Programmatically set Inno Setup Uninstall window caption

How to change the title of the window at the uninstall?
We need to do this using code, similarly to this code for install window caption:
procedure InitializeWizard();
begin
WizardForm.Caption := 'Setup Application';
end;
Use UninstallProgressForm global variable from InitializeUninstallProgressForm event function to access uninstall form.
[Code]
procedure InitializeUninstallProgressForm();
begin
UninstallProgressForm.Caption := 'Uninstalling';
end;

Code to run after all files are installed

I got the following little function which I need to call after all files of the [Files] section have been copied
procedure DllAfterInstall(platform: Integer);
begin
if not installDriver(platform) then
MsgBox(ExpandConstant('{cm:installDriverFail}'), mbError, MB_OK);
end;
where installDriver(platform) is an external function to one of my dll's.
As soon as I try to call the DllAfterInstall function in the [Run] section like
Filename: "{code:DllAfterInstall}"; Parameters: 0; Check: not IsWin64
I got the error
Invalid prototype for 'DllAfterInstall'
So can anyone tell me what I'm doing wrong? Or maybe is there another way to call a *.dll after all files have been copied? The *.dll function should only be called once so AfterInstall is no option.
Call your code from CurStepChanged event function when CurStep is ssPostInstall:
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
DllAfterInstall(platform);
end;
end;
You also need to provide an actual value to the platform parameter of the function.

How to make the bottom part of Inno Setup pages transparent? (screenshot given)

How can I make an Inno Setup installer like this:
I mean, I want to make the bottom part of Inno Setup pages like the above image.
What Pascal coding should I use?
Thanks. :)
The simplest way is to obtain iswin7.dll library from the internet and use it with following code:
[Files]
Source: ".\ISWin7.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
[Code]
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);
external 'iswin7_add_glass#files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);
external 'iswin7_add_button#files:iswin7.dll stdcall';
procedure iswin7_free;
external 'iswin7_free#files:iswin7.dll stdcall';
procedure InitializeWizard();
begin
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, ScaleY(47), True);
end;
procedure DeinitializeSetup();
begin
iswin7_free;
end;
Keep in mind that iswin7.dll is non-official.

Resources