|
http://pipiscrew.com/
Freewares 4 Developers
>Inno Helper
Is initial release.. and only for NET developers!
|
|
|
|
|
it did not compile in windows vista sp2
|
|
|
|
|
Hi,
How to have the same WizardSmallImageFile during the framework download like the rest of my Setup Wizard?
I tried to add "WizardSmallImageFile = images\logo3.bmp" in products.iss. But when I generate I have the following error : "Already WizardSmallImageFile specified"
Thanks in advance.
modified on Thursday, July 29, 2010 8:14 AM
|
|
|
|
|
I found it! I changed WizardSmallImageFile in the c++ sources. That working now!
bye.
|
|
|
|
|
What C++ sources did you change?
I cant find any of the source files and I kinda need that same thing.
Anthony
|
|
|
|
|
Hi,
I uploaded the code here
You need C++ 2010 and WTL 8.0
The maximum size of the bitmap (WizModernSmallImage) is 55x58 pixels.
You just replace WizModernSmallImage.bmp file in 'source' directory with yours and re-build the solution.
I hope this will help!
Bye
neojudgment
|
|
|
|
|
Ahh getting some code errors in VS 2010
Thanks for the help though! I'll try sort out the errors
Anthony
|
|
|
|
|
Hi Anthony,
Give me a link to your image (WizardSmallImageFile)!! I will build this for you !!
++ neojudgment
|
|
|
|
|
Hi neojudgment,
Don't worry, I've got it to work
Thanks!!
Anthony
|
|
|
|
|
Hi Anthony,
great news !!
bye
neojudgment
|
|
|
|
|
hi can anyone gimme the script in which i could create the listboxes, i.e i want to create a scrollable listbox with few entries in it in a wizardpage
|
|
|
|
|
Hey,
The below two scripts should allow your application to download the latest version of the .NET Framework.
.NET Framework 4 (Full)
Put the below code into a file named "dotnetfx40.iss"
[CustomMessages]
dotnetfx40_title=.NET Framework 4.0
en.dotnetfx40_size=48.1 MB
de.dotnetfx40_size=48,1 MB
[Code]
const
dotnetfx40_url = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';
procedure dotnetfx40();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', version);
if version <> 1 then
AddProduct('dotNetFx40_Full_x86_x64.exe',
'/q /norestart',
CustomMessage('dotnetfx40_title'),
CustomMessage('dotnetfx40_size'),
dotnetfx40_url);
end;
.NET Framework 4 (Client)
Put the below code into a file named "dotnetfx40client.iss"
[CustomMessages]
dotnetfx40_title=.NET Framework 4.0 Client Profile
en.dotnetfx40_size=48.1 MB
de.dotnetfx40_size=48,1 MB
[Code]
const
dotnetfx40_url = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe';
procedure dotnetfx40client();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Client', 'Install', version);
if version <> 1 then
AddProduct('dotNetFx40_Client_x86_x64',
'/q /norestart',
CustomMessage('dotnetfx40_title'),
CustomMessage('dotnetfx40_size'),
dotnetfx40_url);
end;
Don't forget to add the lines #include "dotnetfx40.iss" or #include "dotnetfx40client.iss" at the top of your setup file script.
Anthony
|
|
|
|
|
Here is an update for MSI 4.5 for XP, Vista and Vista-64. Note my previous post about mid-Install reboots. If you don't want this, just remove
,true,true from code.
[CustomMessages]
msi45win60_title=Windows Installer 4.5 for Windows Vista & Windows 7
msi45win52_title=Windows Installer 4.5 for Server 2003
msi45win51_title=Windows Installer 4.5 for Windows XP
msi45win60_size=1.7 MB
msi45win52_size=3.0 MB
msi45win51_size=3.2 MB
[Code]
const
msi45win60_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/Windows6.0-KB942288-v2-x86.msu';
msi45win6064_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/Windows6.0-KB942288-v2-x64.msu';
msi45win52_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsServer2003-KB942288-v4-x86.exe';
msi45win51_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe';
procedure msi45(MinVersion: string);
begin
if minwinversion(6, 0) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
begin
if (IsWin64) then begin
AddProduct('Windows6.0-KB942288-v2-x64.msu',
'/quiet /norestart',
CustomMessage('msi45win60_title'),
CustomMessage('msi45win60_size'),
msi45win6064_url, true, true)
end else begin
AddProduct('Windows6.0-KB942288-v2-x86.msu',
'/quiet /norestart',
CustomMessage('msi45win60_title'),
CustomMessage('msi45win60_size'),
msi45win60_url, true, true)
end;
end
else if minwinversion(5, 2) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('WindowsServer2003-KB942288-v4-x86.exe',
'/quiet /norestart',
CustomMessage('msi45win52_title'),
CustomMessage('msi45win52_size'),
msi45win52_url, true, true)
else if minwinversion(5, 1) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('WindowsXP-KB942288-v3-x86.exe',
'/quiet /norestart',
CustomMessage('msi45win51_title'),
CustomMessage('msi45win51_size'),
msi45win51_url, true, true);
end;
|
|
|
|
|
Thought I would submit some enhancements to the product.iss file. With the latest version of InnoSetup the PrepareInstall function allows us to easily perform mid-Install reboots. With some minor changes to the product.iss file we can take advantage of this.
I added two new fields to the TProduct record to specify if the product must reboot after (Installer 4.5 requires this), or if the install requires a clean install (i.e. no pending reboots). For example .NET 4.0 requires a clean install, but .NET 3.5 SP1 does not. You do have to change all the product files to include these extract variables though.
The new function PendingReboot will detect if a reboot is pending by checking the registry for any queued up any executables or file renames. You can check for this at the start of your installation to ensure a clean install.
If a reboot is required, the install stops and then configures setup to be automatically re-run after reboot.
Note that I also changed error code 3010 to 0. This is MSI's way of reporting a delayed boot, but for my purposes I wanted to treat it as success.
One issue with this is that when prompted for a reboot, you can hit the back button. To get around this, I disabled it in my main install code.
function BackButtonClick(CurPageID: Integer): Boolean;
begin
if (CurPageID = 11) then
Result := false
else
Result := true;
end;
Here is the changed product.iss file:
#include "isxdl\isxdl.iss"
[CustomMessages]
DependenciesDir=MyProgramDependencies
en.depdownload_msg=The following applications are required before setup can continue:%n%n%1%nDownload and install now?
de.depdownload_msg=Die folgenden Programme werden benötigt bevor das Setup fortfahren kann:%n%n%1%nJetzt downloaden und installieren?
en.depdownload_memo_title=Download dependencies
de.depdownload_memo_title=Abhängigkeiten downloaden
en.depinstall_memo_title=Install dependencies
de.depinstall_memo_title=Abhängigkeiten installieren
en.depinstall_title=Installing dependencies
de.depinstall_title=Installiere Abhängigkeiten
en.depinstall_description=Please wait while Setup installs dependencies on your computer.
de.depinstall_description=Warten Sie bitte während Abhängigkeiten auf Ihrem Computer installiert wird.
en.depinstall_status=Installing %1...
de.depinstall_status=Installiere %1...
en.depinstall_missing=%1 must be installed before setup can continue. Please install %1 and run Setup again.
de.depinstall_missing=%1 muss installiert werden bevor das Setup fortfahren kann. Bitte installieren Sie %1 und starten Sie das Setup erneut.
en.depinstall_error=An error occured while installing the dependencies. Please restart the computer and run the setup again or install the following dependencies manually:%n
de.depinstall_error=Ein Fehler ist während der Installation der Abghängigkeiten aufgetreten. Bitte starten Sie den Computer neu und führen Sie das Setup erneut aus oder installieren Sie die folgenden Abhängigkeiten per Hand:%n
de.isxdl_langfile=german2.ini
[Files]
Source: "scripts\isxdl\german2.ini"; Flags: dontcopy
[Code]
type
TProduct = record
File: String;
Title: String;
Parameters: String;
InstallClean : Boolean;
MustRebootAfter : Boolean;
end;
var
installMemo, downloadMemo, downloadMessage: string;
products: array of TProduct;
DependencyPage: TOutputProgressWizardPage;
rebootRequired : boolean;
rebootMessage : string;
procedure AddProduct(FileName, Parameters, Title, Size, URL: string; InstallClean : Boolean; MustRebootAfter : Boolean);
var
path: string;
i: Integer;
begin
installMemo := installMemo + '%1' + Title + #13;
path := ExpandConstant('{src}{\}') + CustomMessage('DependenciesDir') + '\' + FileName;
if not FileExists(path) then begin
path := ExpandConstant('{tmp}{\}') + FileName;
isxdl_AddFile(URL, path);
downloadMemo := downloadMemo + '%1' + Title + #13;
downloadMessage := downloadMessage + ' ' + Title + ' (' + Size + ')' + #13;
end;
i := GetArrayLength(products);
SetArrayLength(products, i + 1);
products[i].File := path;
products[i].Title := Title;
products[i].Parameters := Parameters;
products[i].InstallClean := InstallClean;
products[i].MustRebootAfter := MustRebootAfter;
end;
function SmartExec(fileName, parameters : string; var ResultCode : Integer) : Boolean;
begin
if (UpperCase(Copy(fileName,Length(fileName)-2,3)) <> 'EXE') then begin
Result := ShellExec('', fileName, parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end else begin
Result := Exec(fileName, parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end;
// MSI Deferred boot code 3010 is a success
if (ResultCode = 3010) then ResultCode := 0;
end;
function PendingReboot : Boolean;
var Names: String;
begin
if (RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations', Names)) then begin
Result := true;
end else if ((RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'SetupExecute', Names)) and (Names <> '')) then begin
Result := true;
end
else begin
Result := false;
end;
end;
function InstallProducts: Boolean;
var
ResultCode, i, productCount, finishCount: Integer;
begin
Result := true;
productCount := GetArrayLength(products);
if productCount > 0 then begin
DependencyPage := CreateOutputProgressPage(CustomMessage('depinstall_title'), CustomMessage('depinstall_description'));
DependencyPage.Show;
for i := 0 to productCount - 1 do begin
if ((products[i].InstallClean = true) and PendingReboot) then
begin
rebootRequired := true;
rebootmessage := products[i].Title;
exit;
end;
DependencyPage.SetText(FmtMessage(CustomMessage('depinstall_status'), [products[i].Title]), '');
DependencyPage.SetProgress(i, productCount);
if SmartExec(products[i].File, products[i].Parameters, ResultCode) then begin
//success; ResultCode contains the exit code
if ResultCode = 0 then begin
finishCount := finishCount + 1
if (products[i].MustRebootAfter = true) then begin
rebootRequired := true;
rebootmessage := products[i].Title;
if not PendingReboot then begin
RegWriteMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations', '');
end;
exit;
end;
end
else begin
Result := false;
break;
end;
end else begin
//failure; ResultCode contains the error code
Result := false;
break;
end;
end;
//only leave not installed products for error message
for i := 0 to productCount - finishCount - 1 do begin
products[i] := products[i+finishCount];
end;
SetArrayLength(products, productCount - finishCount);
DependencyPage.Hide;
end;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
i: Integer;
s: string;
begin
if not InstallProducts() then begin
s := CustomMessage('depinstall_error');
for i := 0 to GetArrayLength(products) - 1 do begin
s := s + #13 + ' ' + products[i].Title;
end;
Result := s;
end
else if (rebootrequired) then
begin
Result := RebootMessage;
NeedsRestart := true;
RegWriteStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce',
'InstallBootstrap', ExpandConstant('{srcexe}'));
end;
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
s: string;
begin
if downloadMemo <> '' then
s := s + CustomMessage('depdownload_memo_title') + ':' + NewLine + FmtMessage(downloadMemo, [Space]) + NewLine;
if installMemo <> '' then
s := s + CustomMessage('depinstall_memo_title') + ':' + NewLine + FmtMessage(installMemo, [Space]) + NewLine;
s := s + MemoDirInfo + NewLine + NewLine + MemoGroupInfo
if MemoTasksInfo <> '' then
s := s + NewLine + NewLine + MemoTasksInfo;
Result := s
end;
function ProductNextButtonClick(CurPageID: Integer): Boolean;
begin
Result := true;
if CurPageID = wpReady then begin
if downloadMemo <> '' then begin
//change isxdl language only if it is not english because isxdl default language is already english
if ActiveLanguage() <> 'en' then begin
ExtractTemporaryFile(CustomMessage('isxdl_langfile'));
isxdl_SetOption('language', ExpandConstant('{tmp}{\}') + CustomMessage('isxdl_langfile'));
end;
//isxdl_SetOption('title', FmtMessage(SetupMessage(msgSetupWindowTitle), [CustomMessage('appname')]));
if SuppressibleMsgBox(FmtMessage(CustomMessage('depdownload_msg'), [downloadMessage]), mbConfirmation, MB_YESNO, IDYES) = IDNO then
Result := false
else if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhwnd}'))) = 0 then
Result := false;
end;
end;
end;
function IsX64: Boolean;
begin
Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
end;
function IsIA64: Boolean;
begin
Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64);
end;
function GetURL(x86, x64, ia64: String): String;
begin
if IsX64() and (x64 <> '') then
Result := x64;
if IsIA64() and (ia64 <> '') then
Result := ia64;
if Result = '' then
Result := x86;
end;
|
|
|
|
|
It seems once I added this, everything just stopped working! When trying to execute the program.
The problem I am having is that on the Preparing to Install it does not even try to download anything, it just gives an error.
It almost acts like it can't connect to the internet. I can open a web browser and download the dependencies url just fine.
"An error Occurred while installing the dependencies...."
This seems to happen on windows XP SP3 (Fully updated) and Windows 7, I can only assume it does this on every version of windows.
Thanks in Advance.
modified on Saturday, November 20, 2010 8:00 PM
|
|
|
|
|
Excellent contribution... but why is the MSI 4.5 progress bar not updating when installing ???
|
|
|
|
|
Thanks for an excellent adaption of the Inno setup.
I just thought I'd submit back a couple of new scripts that I made to suit additional prerequisites I had for a setup package I created:
- Windows Installer 4.5
- SQL 3.5 Compact Edition for Desktops
- SQL 2008 R2 Express
Windows Installer 4.5 (msi45.iss)
[CustomMessages]
msi45win60_title=Windows Installer 4.5 for Windows Vista & Windows 7
msi45win52_title=Windows Installer 4.5 for Server 2003
msi45win51_title=Windows Installer 4.5 for Windows XP
msi45win60_size=1.7 MB
msi45win52_size=3.0 MB
msi45win51_size=3.2 MB
[Code]
const
msi45win60_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/Windows6.0-KB942288-v2-x86.msu';
msi45win52_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsServer2003-KB942288-v4-x86.exe';
msi45win51_url = 'http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe';
procedure msi45(MinVersion: string);
begin
if minwinversion(6, 0) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('msi45win60.msu',
'/quiet /norestart',
CustomMessage('msi45win60_title'),
CustomMessage('msi45win60_size'),
msi45win60_url)
else if minwinversion(5, 2) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('msi45win52.exe',
'/quiet /norestart',
CustomMessage('msi45win52_title'),
CustomMessage('msi45win52_size'),
msi45win52_url)
else if minwinversion(5, 1) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('msi45win51.exe',
'/quiet /norestart',
CustomMessage('msi45win51_title'),
CustomMessage('msi45win51_size'),
msi45win51_url);
end;
To make the MSU package work (under Vista/Win7), I used the tip from sascha_kib in his posting install .msi packages of Mar 17 2010 (thanks, mate!)
SQL 3.5 Compact Edition for Desktops (ssceruntime.iss)
[CustomMessages]
ssceruntime_title=SQL Server Compact 3.5 Service Pack 2 for Windows Destkop
ssceruntime_unpack=SQL Server Compact 3.5 Service Pack 2 for Windows Destkop (uncompress package)
ssceruntime_size=5.3 MB
[Code]
const
ssceruntime_url = 'http://download.microsoft.com/download/E/C/1/EC1B2340-67A0-4B87-85F0-74D987A27160/SSCERuntime-ENU.exe';
procedure ssceruntime();
var
version: cardinal;
begin
if not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5') then
AddProduct('ssceruntime.msi',
'/qb',
CustomMessage('ssceruntime_title'),
CustomMessage('ssceruntime_size'),
ssceruntime_url);
end;
SQL 2008 R2 Express (sql2008express.iss):
[CustomMessages]
sql2008express_title=SQL Server 2008 R2 Express
en.sql2008express_size=59 MB
de.sql2008express_size=59 MB
[Code]
const
sql2008express_url = 'http://download.microsoft.com/download/5/1/A/51A153F6-6B08-4F94-A7B2-BA1AD482BC75/SQLEXPR32_x86_ENU.exe';
procedure sql2008express();
var
version: string;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion', 'CurrentVersion', version);
if version < '10.5' then
AddProduct('sql2008express.exe',
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="builtin\administrators"',
CustomMessage('sql2008express_title'),
CustomMessage('sql2008express_size'),
sql2008express_url);
end;
Of course, to make these work, put the files together with the others in the scripts\products folder. Then add the appropriate include statements to setup.iss and also the function calls like
#include "scripts\products\sql2008express.iss"
and
sql2008express() .
You should make sure to put these installations after .NET-installations and then the MSI packages before the SQL packages.
Hope this may be of any interest/help to someone out there.
Hovedsjef
(means "Main boss" in norwegian)
http://nerdynotes.blogspot.com
modified on Friday, June 11, 2010 10:03 AM
|
|
|
|
|
|
You are absolutely right - the weblink for this package does not work. It is obvious now that you point it out. For the project I was using it, I had run the package manually and placed the x86 file (which was the one I needed) in the bin\dependencies folder renamed to ssceruntime.msi. Hence, the web download part passed untested for this script.
I ran the install package with the /? switch and found that the following extraction command should work:
ssceruntime-enu /t:c:\temp /c
-which would place the extracted files in the c:\Temp folder (can of course be changed to whatever folder you would like). Now you can pick up the extracted file that you need from there and run it. I haven't done this myself since I have already achieved what I needed to accomplish, but it should not be too hard to figure out how to put this into the script.
|
|
|
|
|
I get some error messages. Unknow identifier
For example:
- AddProduct(
- minwinversion(
|
|
|
|
|
Thanks for this! Exactly what I needed! I have one problem though, after it installs Windows Installer 4.5 it says that there was an error during installation of the dependency and the computer needs to restart. Really, it is just that install Windows Installer 4.5 requires a restart and after we reboot, everything works great. I removed the /norestart flag from the script and we are still running into this error. Is there a way to require a restart but not show it as an error to the user?
|
|
|
|
|
Nick Olsen wrote: Thanks for this! Exactly what I needed! I have one problem though, after it installs Windows Installer 4.5 it says that there was an error during installation of the dependency and the computer needs to restart. Really, it is just that install Windows Installer 4.5 requires a restart and after we reboot, everything works great. I removed the /norestart flag from the script and we are still running into this error. Is there a way to require a restart but not show it as an error to the user?
I am having the same problem while installing MSI 4.5. Did you managed to resolve it??
Thanks cheers!
|
|
|
|
|
I did not ever resolve it. Let me know if you find a solution.
|
|
|
|
|
Hi Nick,
The post by jtitley on the 25 Jun 10 did help me resolved it. You will need to modify the products.iss file
Good Luck!
Cheers
|
|
|
|
|
Good information, but I am having problems installing the Sql Server compact package.When I do the install it does the download fine but I get an error message no matter what I try with .iss code.
"SQL Server Compact 3.5 SP2 Runtime"
"Command line option syntax error. Type Command /? for help."
Microsoft says it has to do with language issues But I can't find any problems. Does anyone have an idea on how to find out what exactly the syntax error is or how to prevent this error. The package does not install after clicking OK.
|
|
|
|
|