ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Choosing an Installer

<< < (6/6)

Renegade:
Well, I've farted around looking at this and that, and finally come up with a mish-mash InnoSetup installer.

If there are any InnoSetup gurus here, would you kindly critique my copy & pasting script (and installer):


--- Code: Text ---[code]function IsDotNetDetected(version: string; service: cardinal): boolean;// Indicates whether the specified version and service pack of the .NET Framework is installed.//// version -- Specify one of these strings for the required .NET Framework version://    'v1.1.4322'     .NET Framework 1.1//    'v2.0.50727'    .NET Framework 2.0//    'v3.0'          .NET Framework 3.0//    'v3.5'          .NET Framework 3.5//    'v4\Client'     .NET Framework 4.0 Client Profile//    'v4\Full'       .NET Framework 4.0 Full Installation//// service -- Specify any non-negative integer for the required service pack level://    0               No service packs required//    1, 2, etc.      Service pack 1, 2, etc. requiredvar    key: string;    install, serviceCount: cardinal;    success: boolean;begin    key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + version;    // .NET 3.0 uses value InstallSuccess in subkey Setup    if Pos('v3.0', version) = 1 then begin        success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);    end else begin        success := RegQueryDWordValue(HKLM, key, 'Install', install);    end;    // .NET 4.0 uses value Servicing instead of SP    if Pos('v4', version) = 1 then begin        success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);    end else begin        success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);    end;    result := success and (install = 1) and (serviceCount >= service);end; function InitializeSetup(): Boolean;var    downloadit: boolean;    ErrorCode: Integer;begin    if not IsDotNetDetected('v4\Client', 0) then begin        downloadit := MsgBox('Photo Resizer requires the Microsoft .NET Framework 4.0. It is a free download from Microsoft.'#13#13            'RECOMMENDED STEPS: '#13#13            '1) Download .NET 4 from Microsoft by clicking YES below. (This setup will exit - See step #3.)'#13            '2) Install .NET 4 by running dotNetFx40Fullx86x64.exe (the download).'#13             '3) Run the Photo Resizer setup program again.'#13#13             'Do you want to download the .NET 4 framework now?', mbInformation, MB_YESNO) = idYes;        result := false;        if downloadit = false then        begin         Result:=false;        end else        begin          Result:=false;          ShellExec('open',            'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',            '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);       end;    end else        result := true;end;
The script is modified from here:

http://www.kynosarges.de/DotNetVersion.html


This installer never installs - it just shows the error message above:
http://renegademinds.com/Portals/0/PhotoResizer/NeverInstalls.exe

This is the installer:
http://renegademinds.com/Portals/0/PhotoResizer/PhotoResizer-setup.exe



I'm still tweaking the core installer, but the script stuff above I won't be touching.

Any advice/criticism is welcome. I'm new to InnoSetup (more or less as I've only edited them before), so...

(And I determined in 1992 that I hate Pascal. :) )



Please note that this is a bit of a lazy post as I'm experiencing an odd Windows bug -- Explorer isn't refreshing properly -- This is havoc for me to test the installer because the Start Menu isn't refreshing properly either...

As such, I'm in the process of downloading Windows 7 to install on a VM... However, if you know what the Aussie shinternet is like, this is taking some time, and inordinately more than it should... Hence, my posting ahead of when I should with work I should be doing on my own...

Thank you in advance for your understanding. :)

EDIT: Updated installers to look a bit better. Still experimenting though...[/code]

Ath:
Hm, sorry you missed my post, earlier in this thread. I pointed to my blog to the script we used for JottiQ, that is modular, and can detect .NET 4, and download and install it during the setup phase if it's missing. I looked at the kynosarges page before, but I missed the automatic download feature, so I upgraded another initiative.

If you can wait a few hours (I'm now at the start of my working day, and I'm busy for the next 10 hours or so) I can update your script to have that incorporated.
The whirlwind at the JottiQ thread shows it's quite tested a few times ;) And it'd be for free ofcourse :D

Renegade:
Hm, sorry you missed my post, earlier in this thread. I pointed to my blog to the script we used for JottiQ, that is modular, and can detect .NET 4, and download and install it during the setup phase if it's missing. I looked at the kynosarges page before, but I missed the automatic download feature, so I upgraded another initiative.

If you can wait a few hours (I'm now at the start of my working day, and I'm busy for the next 10 hours or so) I can update your script to have that incorporated.
The whirlwind at the JottiQ thread shows it's quite tested a few times ;) And it'd be for free ofcourse :D
-Ath (January 31, 2011, 01:35 AM)
--- End quote ---

Oh! I didn't know that it needed .NET 4 or that you did that in the installer!

And I'd appreciate that. I checked out the stuff at the Code Project, but it was just long, and I wanted to just get it done. I didn't know that it did the install during setup like that.

Ath:
...I checked out the stuff at the Code Project, ...
-Renegade (January 31, 2011, 01:48 AM)
--- End quote ---

That's the base I used, indeed.
I'll start at your script tonight, when I'm home.

Renegade:
...I checked out the stuff at the Code Project, ...
-Renegade (January 31, 2011, 01:48 AM)
--- End quote ---

That's the base I used, indeed.
I'll start at your script tonight, when I'm home.
-Ath (January 31, 2011, 01:54 AM)
--- End quote ---

Thank you very much~! :D

Navigation

[0] Message Index

[*] Previous page

Go to full version