aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Szabo <szabgab@gmail.com>2011-06-07 09:42:02 +0300
committerGabor Szabo <szabgab@gmail.com>2011-06-07 09:42:02 +0300
commit81c1fdcfedca9a52a03ce1f13707dc5633af1ad5 (patch)
tree1bde9abd1b1029eb4396dcd3cd1b10eec08f5a21
parentff57d8f91a9a2e23ba5e4b355041dc2dad48459b (diff)
add files needed to build the Windows Installer of Rakudo Star
-rw-r--r--win32/rakudo.iss118
-rw-r--r--win32/rakudo.txt32
2 files changed, 150 insertions, 0 deletions
diff --git a/win32/rakudo.iss b/win32/rakudo.iss
new file mode 100644
index 0000000..d9d5932
--- /dev/null
+++ b/win32/rakudo.iss
@@ -0,0 +1,118 @@
+; -- rakudo.iss --
+
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
+; using ISC 5.4.2(a)
+
+
+[Setup]
+AppName=Rakudo Star
+AppVersion=2011.04
+DefaultDirName=c:\rakudo
+; Currently the installation path needs to be hard-coded
+DisableDirPage=yes
+DefaultGroupName=Rakudo Star
+; UninstallDisplayIcon={app}\MyProg.exe
+Compression=lzma2
+SolidCompression=yes
+SourceDir=c:\rakudo
+OutputDir=c:\output
+OutputBaseFilename=rakudo-star
+;AppComments=
+AppContact=http://rakudo.org/
+; AppCopyright=
+AppId=Rakudo_Star
+; AppMutex= TODO!
+AppPublisherURL=http://rakudo.org/
+
+; ChangesAssociations=yes
+ChangesEnvironment=yes
+;InfoAfterFile=README_FIRST.txt
+
+
+[Registry]
+
+Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
+ ValueName: "Path"; ValueType: expandsz; ValueData: "{olddata};{code:getPath}"; \
+ Check: NeedsAddPath('\rakudo\bin');
+; Check: NeedsAddPath('\rakudo\install\bin');
+; TODO: don't add the leading semi-colon to the Path if there is already a trailing one
+
+[Files]
+; Excludes: "cpan_sqlite_log*,cpan/build/*,cpan/sources/*,cpan/Bundle/*";
+Source: "*"; DestDir: "{app}"; Flags: "recursesubdirs"
+
+[Icons]
+Name: "{group}\Rakudo REPL"; Filename: "{app}\bin\perl6.exe"; WorkingDir: "{app}"
+Name: "{group}\Uninstall"; Filename: "{app}\unins000.exe"
+; Name: "{group}\Rakudo README"; Filename: "{app}\share\doc\rakudo\README"
+
+
+[Code]
+function getPath(Param: String): string;
+begin
+// Result := ExpandConstant('{app}') + '\install\bin;'
+ Result := ExpandConstant('{app}') + '\bin;'
+end;
+
+// From http://stackoverflow.com/questions/3304463/how-do-i-modify-the-path-environment-variable-when-running-an-inno-setup-installe
+function NeedsAddPath(Param: string): boolean;
+var
+ OrigPath: string;
+begin
+ if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
+ 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
+ 'Path', OrigPath)
+ then begin
+ Result := True;
+ exit;
+ end;
+ // look for the path with leading and trailing semicolon
+ // Pos() returns 0 if not found
+ //Result := Pos(';' + ExpandConstant('{app}') + Param + ';', OrigPath) = 0;
+ Result := Pos(getPath(''), OrigPath) = 0;
+end;
+
+function RemovePath(): boolean;
+var
+ OrigPath: string;
+ start_pos: Longint;
+ end_pos: Longint;
+ new_str: string;
+begin
+ if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
+ 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
+ 'Path', OrigPath)
+ then begin
+ Result := True;
+ exit;
+ end;
+ start_pos := Pos(getPath(''), OrigPath);
+ end_pos := start_pos + Length(getPath(''));
+ new_str := Copy(OrigPath, 0, start_pos-1) + Copy(OrigPath, end_pos, Length(OrigPath));
+ RegWriteExpandStringValue(HKEY_LOCAL_MACHINE,
+ 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
+ 'Path', new_str);
+ Result := True;
+end;
+function InitializeUninstall(): Boolean;
+begin
+ Result := True;
+ RemovePath();
+end;
+
+
+// Restrict the installation path to have no space
+function NextButtonClick(CurPageID: Integer): Boolean;
+begin
+ Result :=True;
+ case CurPageID of
+ wpSelectDir :
+ begin
+ if Pos(' ', ExpandConstant('{app}') ) <> 0 then
+ begin
+ MsgBox('You cannot install to a path containing spaces. Please select a different path.', mbError, mb_Ok);
+ Result := False;
+ end;
+ end;
+ end;
+end;
diff --git a/win32/rakudo.txt b/win32/rakudo.txt
new file mode 100644
index 0000000..a63adc5
--- /dev/null
+++ b/win32/rakudo.txt
@@ -0,0 +1,32 @@
+This directory is for building the Windows installer for Rakudo Star.
+
+You will need
+- Strawberry Perl (eg. the one that comes with Padre from
+ http://padre.perlide.org/download.html )
+ padre-0.84-on-strawberry-5.12.3.0-v3.exe
+- Inno Setup from http://www.jrsoftware.org/isinfo.php
+ 5.4.2(a)
+
+Download The source distribution of Rakudo Star from https://github.com/rakudo/star/downloads
+ptar -xzf rakudo-star-2011.04.tar.gz
+cd rakudo-star-2011.04
+
+As currently the executable is not relocatable we need to decide
+which directory to install. Currently it is c:\rakudo
+
+Follow the insturctions in the README of Rakudo Star:
+
+> perl Configure.pl --gen-parrot --prefix c:\rakudo
+> gmake
+> gmake install
+
+Manually copy c:\strawberry\c\bin\libgcc_s_sjlj-1.dll to c:\rakudo\bin
+
+Create a directory called c:\output where the resulting executable will be placed.
+Then start the Inno Setup Compiler and open the rakudo.iss file.
+Change the "AppVersion" field.
+
+Click on "Build/Compile"
+
+This should generate c:\output\rakudo-star.exe
+