Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 03, 2015, 05:55:57 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Choosing an Installer  (Read 4574 times)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 12,787
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Choosing an Installer
« Reply #25 on: January 30, 2011, 09:01:08 PM »
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
  1.  
  2. [code]
  3. function IsDotNetDetected(version: string; service: cardinal): boolean;
  4. // Indicates whether the specified version and service pack of the .NET Framework is installed.
  5. //
  6. // version -- Specify one of these strings for the required .NET Framework version:
  7. //    'v1.1.4322'     .NET Framework 1.1
  8. //    'v2.0.50727'    .NET Framework 2.0
  9. //    'v3.0'          .NET Framework 3.0
  10. //    'v3.5'          .NET Framework 3.5
  11. //    'v4\Client'     .NET Framework 4.0 Client Profile
  12. //    'v4\Full'       .NET Framework 4.0 Full Installation
  13. //
  14. // service -- Specify any non-negative integer for the required service pack level:
  15. //    0               No service packs required
  16. //    1, 2, etc.      Service pack 1, 2, etc. required
  17. var
  18.     key: string;
  19.     install, serviceCount: cardinal;
  20.     success: boolean;
  21. begin
  22.     key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + version;
  23.     // .NET 3.0 uses value InstallSuccess in subkey Setup
  24.     if Pos('v3.0', version) = 1 then begin
  25.         success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
  26.     end else begin
  27.         success := RegQueryDWordValue(HKLM, key, 'Install', install);
  28.     end;
  29.     // .NET 4.0 uses value Servicing instead of SP
  30.     if Pos('v4', version) = 1 then begin
  31.         success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
  32.     end else begin
  33.         success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
  34.     end;
  35.     result := success and (install = 1) and (serviceCount >= service);
  36. end;
  37.  
  38. function InitializeSetup(): Boolean;
  39. var
  40.     downloadit: boolean;
  41.     ErrorCode: Integer;
  42. begin
  43.     if not IsDotNetDetected('v4\Client', 0) then begin
  44.         downloadit := MsgBox('Photo Resizer requires the Microsoft .NET Framework 4.0. It is a free download from Microsoft.'#13#13
  45.             'RECOMMENDED STEPS: '#13#13
  46.             '1) Download .NET 4 from Microsoft by clicking YES below. (This setup will exit - See step #3.)'#13
  47.             '2) Install .NET 4 by running dotNetFx40Fullx86x64.exe (the download).'#13
  48.             '3) Run the Photo Resizer setup program again.'#13#13
  49.             'Do you want to download the .NET 4 framework now?', mbInformation, MB_YESNO) = idYes;
  50.         result := false;
  51.         if downloadit = false then
  52.         begin
  53.          Result:=false;
  54.         end else
  55.         begin
  56.           Result:=false;
  57.           ShellExec('open',
  58.             'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe',
  59.             '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
  60.        end;
  61.     end else
  62.         result := true;
  63. end;
  64.  
  65.  

The script is modified from here:

http://www.kynosarge...e/DotNetVersion.html


This installer never installs - it just shows the error message above:
http://renegademinds...er/NeverInstalls.exe

This is the installer:
http://renegademinds...otoResizer-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]
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker
« Last Edit: January 31, 2011, 12:17:27 AM by Renegade »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,537
    • View Profile
    • Donate to Member
Re: Choosing an Installer
« Reply #26 on: January 31, 2011, 01:35:06 AM »
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

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 12,787
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Choosing an Installer
« Reply #27 on: January 31, 2011, 01:48:35 AM »
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

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.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,537
    • View Profile
    • Donate to Member
Re: Choosing an Installer
« Reply #28 on: January 31, 2011, 01:54:01 AM »
...I checked out the stuff at the Code Project, ...

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

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 12,787
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Choosing an Installer
« Reply #29 on: January 31, 2011, 02:01:45 AM »
...I checked out the stuff at the Code Project, ...

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

Thank you very much~! :D
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker