; Script generated by the My Inno Setup Extensions Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; My thanks to Robert Cowham <robert@vaccaperna.co.uk> for getting this installer ; started. Without him I doubt if I'd have bothered. TS 28/11/2002 [Setup] AppName=P4Ruby: The Perforce API for Ruby 1.6 AppVerName=P4Ruby 1.5953 (Ruby 1.6.8) AppPublisher=Tony Smith <tony@smee.org> AppPublisherURL=http://www.smee.org AppSupportURL=http://public.perforce.com/guest/tony_smith/perforce/API/Ruby/index.html AppUpdatesURL=http://public.perforce.com/guest/tony_smith/perforce/API/Ruby/main/Changes DefaultDirName={code:RubyLibDir} DisableProgramGroupPage=yes DirExistsWarning=no DisableDirPage=yes SourceDir=.. OutputDir=..\current OutputBasefilename=p4ruby-main-1.6.8-setup WindowVisible=yes [Files] Source: "P4.so"; DestDir: "{code:RubyArchDir}"; Flags: ignoreversion; Source: "lib\P4.rb"; DestDir: "{code:RubyLibDir}"; Flags: ignoreversion; [Code] // This section is the Pascal script - various procedures called from above. program Setup; var RubyLibPath: String; RubyArchPath: String; RubyVersion: String; //--------------------------------------------------- // Called automatically at the start of initialization function InitializeSetup(): Boolean; var TempFile: String; Cmd: String; RubyBuildVer: String; Lines: TArrayOfString; i: Longint; ResultCode: Integer; begin // Make sure Ruby is installed and work out where to copy library Result := false; // Version of Ruby we're looking for RubyBuildVer := '1.6'; TempFile := GenerateUniqueName(GetTempDir(), '.ini'); // // Some fiddling to find appropriate way to get output - straight piping didn't seem to work. // We use Ruby's rbconfig.rb file to figure out where to put the files. Currently at least // I'm ignoring the site_lib directory as Ruby's own mkmf seems to so all existing P4/Ruby // installs will not have used the site_lib tree either. // // Note: use %q{} to do single quotes inside the Pascal quotes. It also saves us // having to escape the \'s in the file path as well as saving us from horrible // multiple quotes (e.g. '''' ) // Cmd := '"require %q{rbconfig}; '; Cmd := Cmd + 'File.open( %q{' + TempFile + '}, %q{w}) {'; Cmd := Cmd + ' |f|'; Cmd := Cmd + ' f.puts( %q{RubyLibPath=} + Config::CONFIG[ %q{rubylibdir} ] );'; Cmd := Cmd + ' f.puts( %q{RubyArchPath=} + Config::CONFIG[ %q{archdir} ] );'; Cmd := Cmd + ' f.puts( %q{RubyVersion=} + RUBY_VERSION );'; Cmd := Cmd + '}"'; Cmd := '-e ' + Cmd; if not Exec('ruby.exe', Cmd, GetTempDir(), SW_SHOWMINNOACTIVE, ewWaitUntilTerminated, ResultCode) then begin MsgBox('Can''t find ruby.exe in your path - Ruby doesn''t seem to be installed.' + #13#13 'Please fix this and try again!', mbError, MB_OK); end else begin if not LoadStringsFromFile(TempFile, Lines) then begin MsgBox('Error loading strings '' from file.', mbError, MB_OK); end else begin // Extract the RubyLibDir and RubyArchDir paths from the file for i := 0 to GetArrayLength( Lines ) - 1 do begin if ( Pos( 'RubyLibPath=', Lines[ i ] ) = 1 ) then begin RubyLibPath := Lines[ i ]; StringChange( RubyLibPath, 'RubyLibPath=', '' ); StringChange( RubyLibPath, '/', '\' ); // Convert to right seperators end; if ( Pos( 'RubyArchPath=', Lines[ i ] ) = 1 ) then begin RubyArchPath := Lines[ i ]; StringChange( RubyArchPath, 'RubyArchPath=', '' ); StringChange( RubyArchPath, '/', '\' ); // Convert to right seperators end; if ( Pos( 'RubyVersion=', Lines[ i ] ) = 1 ) then begin RubyVersion := Lines[ i ]; StringChange( RubyVersion, 'RubyVersion=', '' ); end; end; if ( ( Length( RubyLibPath ) > 0 ) and ( Length( RubyArchPath ) > 0 ) ) then begin Result := true end else begin MsgBox('Unable to determine Ruby lib and arch directories', mbError, MB_OK); end; if ( Length( RubyVersion ) > 0) then begin if ( Pos( RubyBuildVer, RubyVersion ) <> 1 ) then begin MsgBox( 'Incorrect Ruby Version. This installer is for Ruby ' + RubyBuildVer + '. You appear to be running Ruby ' + RubyVersion + '. If you have more than one Ruby installed, check your ' + 'PATH environment variable and make sure that Ruby ' + RubyBuildVer + ' is first in the PATH.', mbError, MB_OK ); Result := false; end; end; end; DeleteFile(TempFile); end; end; //---------------------------- function RubyLibDir(Default: String): String; begin Result := RubyLibPath; end; function RubyArchDir( Default: String): String; begin Result := RubyArchPath; end; begin end.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#18 | 6004 | Tony Smith |
P4Ruby 1.5953 installers for Ruby 1.6 and Ruby 1.8 Built with 2007.2 API |
||
#17 | 5796 | Tony Smith |
Update P4Ruby installers to build 1.5795. Built with 2006.1 API. |
||
#16 | 5769 | Tony Smith |
Update P4Ruby installers to 1.5768. Built with 2006.1 API |
||
#15 | 5340 | Tony Smith | Update P4Ruby installers to 1.5339 built with 2005.2 API | ||
#14 | 5336 | Tony Smith |
Update P4Ruby installers to build 1.5335. Built with 2005.2 API |
||
#13 | 5312 | Tony Smith | Update P4Ruby installers to build 1.5311 using 2005.2 API | ||
#12 | 5287 | Tony Smith | Update P4Ruby installers to build 1.5279 | ||
#11 | 5260 | Tony Smith | Update P4Ruby installers to build 1.5258 | ||
#10 | 5106 | Tony Smith |
P4Ruby installers for version 1.5105. Note that the Ruby 1.8 installer is now built with Ruby 1.8.2. |
||
#9 | 4943 | Tony Smith | Update P4Ruby installers to build 4942 | ||
#8 | 4846 | Tony Smith | Update P4Ruby installers to 1.4841 build | ||
#7 | 4811 | Tony Smith | Update P4Ruby installers to build 4809 | ||
#6 | 4757 | Tony Smith |
Updated P4Ruby and P4Perl installers for changes 4753 AND 4754 respectively. |
||
#5 | 4659 | Tony Smith | Update P4Ruby installers to 1.4651 release. | ||
#4 | 4594 | Tony Smith | Update P4Ruby installers to 1.4593 build | ||
#3 | 4588 | Tony Smith |
Update P4Ruby installers for Ruby 1.6.x and 1.8.x to P4Ruby 1.4587. This also adds some checks to the installer to validate the ruby version the user is using before proceeding. |
||
#2 | 4263 | Tony Smith | Update current P4Ruby installer to 1.4261 to include new spec parsing functionality. | ||
#1 | 4252 | Tony Smith | Update P4Ruby installer to 1.4251 for both Ruby 1.6 and Ruby 1.8. | ||
//guest/tony_smith/perforce/API/Ruby/main/installer/p4ruby.iss | |||||
#6 | 3905 | Tony Smith | Updated mainline installers for P4Ruby - both for Ruby 1.6.x and 1.8.x | ||
#5 | 3580 | Tony Smith |
New P4Ruby 1.3578 installers. One for Ruby 1.6 users and one for the recently released Ruby 1.8. |
||
#4 | 2595 | Tony Smith | P4Ruby 1.2593 (2002.2 API) installer for ntx86 | ||
#3 | 2441 | Tony Smith | More installer tweaks for P4Ruby and P4Perl | ||
#2 | 2423 | Tony Smith |
Windows installer for P4/Ruby build 1.2409. Many thanks to Robert Cowham! |
||
#1 | 2422 | Tony Smith | Pull in Robert's installer for P4Ruby. | ||
//guest/robert_cowham/perforce/API/ruby/installer/p4ruby.iss | |||||
#1 | 2413 | Robert Cowham |
First version of installer for prebuilt Ruby API. Uses freeware My Inno Setup Extensions from http://www.wintax.nl/isx/ |