|
| 1 | +#define MyAppName "SageMath" |
| 2 | +#define MyAppVersion "7.4" |
| 3 | +#define MyAppPublisher "SageMath" |
| 4 | +#define MyAppURL "http://www.sagemath.org/" |
| 5 | +#define MyAppContact "http://www.sagemath.org/" |
| 6 | + |
| 7 | +#define SageGroupName "SageMath" |
| 8 | + |
| 9 | +#ifndef Compression |
| 10 | + #define Compression "lzma" |
| 11 | +#endif |
| 12 | + |
| 13 | +#ifndef AppBuildDir |
| 14 | + #define AppBuildDir "build" |
| 15 | +#endif |
| 16 | + |
| 17 | +#ifndef DiskSpanning |
| 18 | + #if Compression == "none" |
| 19 | + #define DiskSpanning="yes" |
| 20 | + #else |
| 21 | + #define DiskSpanning="no" |
| 22 | + #endif |
| 23 | +#endif |
| 24 | + |
| 25 | +#define Bin "{app}\app\bin" |
| 26 | +#define OptSageMath "{app}\app\opt\sagemath-" + MyAppVersion |
| 27 | +#define OptSageMathPosix "/opt/sagemath-" + MyAppVersion |
| 28 | + |
| 29 | +[Setup] |
| 30 | +AppCopyright={#MyAppPublisher} |
| 31 | +AppId={#MyAppName} |
| 32 | +AppContact={#MyAppContact} |
| 33 | +AppComments={#MyAppURL} |
| 34 | +AppName={#MyAppName} |
| 35 | +AppVersion={#MyAppVersion} |
| 36 | +AppPublisher={#MyAppPublisher} |
| 37 | +AppPublisherURL={#MyAppURL} |
| 38 | +AppSupportURL={#MyAppURL} |
| 39 | +AppUpdatesURL={#MyAppURL} |
| 40 | +ArchitecturesAllowed=x64 |
| 41 | +ArchitecturesInstallIn64BitMode=x64 |
| 42 | +DefaultDirName={pf}\{#SageGroupName} |
| 43 | +DefaultGroupName={#SageGroupName} |
| 44 | +DisableProgramGroupPage=yes |
| 45 | +DisableWelcomePage=no |
| 46 | +DiskSpanning={#DiskSpanning} |
| 47 | +OutputDir=dist |
| 48 | +OutputBaseFilename={#MyAppName}-{#MyAppVersion} |
| 49 | +Compression={#Compression} |
| 50 | +SolidCompression=yes |
| 51 | +WizardImageFile=resources\sage-banner.bmp |
| 52 | +WizardSmallImageFile=resources\sage-sticker.bmp |
| 53 | +WizardImageStretch=yes |
| 54 | +UninstallDisplayIcon={app}\unins000.exe |
| 55 | +SetupIconFile=resources\sage-floppy-disk.ico |
| 56 | +ChangesEnvironment=true |
| 57 | +SetupLogging=yes |
| 58 | + |
| 59 | +[Languages] |
| 60 | +Name: "english"; MessagesFile: "compiler:Default.isl" |
| 61 | + |
| 62 | +[Tasks] |
| 63 | +Name: startmenu; Description: "Create &start menu icons"; GroupDescription: "Additional icons" |
| 64 | +Name: desktop; Description: "Create &desktop icons"; GroupDescription: "Additional icons" |
| 65 | + |
| 66 | +[Files] |
| 67 | +Source: "dot_sage\*"; DestDir: "{#OptSageMath}\dot_sage"; Flags: recursesubdirs ignoreversion |
| 68 | +Source: "{#AppBuildDir}\app\*"; DestDir: "{app}\app"; Flags: recursesubdirs ignoreversion |
| 69 | +Source: "resources\sagemath.ico"; DestDir: "{app}"; Flags: ignoreversion; AfterInstall: FixupSymlinks |
| 70 | + |
| 71 | +; InnoSetup will not create empty directories found when including files |
| 72 | +; recursively in the [Files] section, so any directories that must exist |
| 73 | +; (but start out empty) in the cygwin distribution must be created |
| 74 | +; |
| 75 | +; /etc/fstab.d is where user-specific mount tables go--this is used in |
| 76 | +; sage for windows by /etc/sagerc to set up the /dot_sage mount point for |
| 77 | +; each user's DOT_SAGE directory, since the actual path name might contain |
| 78 | +; spaces and other special characters not handled well by some software that |
| 79 | +; uses DOT_SAGE |
| 80 | +; |
| 81 | +; /dev/shm and /dev/mqueue are used by the system for POSIX semaphores, shared |
| 82 | +; memory, and message queues and must be created world-writeable |
| 83 | +[Dirs] |
| 84 | +Name: "{app}\app\etc\fstab.d"; Permissions: users-modify |
| 85 | +Name: "{app}\app\dev\shm"; Permissions: users-modify |
| 86 | +Name: "{app}\app\dev\mqueue"; Permissions: users-modify |
| 87 | + |
| 88 | +[UninstallDelete] |
| 89 | +Type: filesandordirs; Name: "{app}\app\etc\fstab.d" |
| 90 | +Type: filesandordirs; Name: "{app}\app\dev\shm" |
| 91 | +Type: filesandordirs; Name: "{app}\app\dev\mqueue" |
| 92 | + |
| 93 | +#define RunSage "/bin/bash --login -c '" + OptSageMathPosix + "/sage'" |
| 94 | +#define RunSageDoc "The SageMath console interface" |
| 95 | +#define RunSageSh "/bin/bash --login -c '" + OptSageMathPosix + "/sage -sh'" |
| 96 | +#define RunSageShDoc "Command prompt in the SageMath shell environment" |
| 97 | +#define RunSageNotebook "/bin/bash --login -c '" + OptSageMathPosix + "/sage --notebook jupyter'" |
| 98 | +#define RunSageNotebookDoc "Start SageMath notebook server" |
| 99 | + |
| 100 | +[Icons] |
| 101 | +Name: "{app}\SageMath"; Filename: "{#bin}\mintty.exe"; Parameters: "-t SageMath -i sagemath.ico {#RunSage}"; WorkingDir: "{app}"; Comment: "{#RunSageDoc}"; IconFilename: "{app}\sagemath.ico" |
| 102 | +Name: "{group}\SageMath"; Filename: "{#bin}\mintty.exe"; Parameters: "-t SageMath -i sagemath.ico {#RunSage}"; WorkingDir: "{app}"; Comment: "{#RunSageDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: startmenu |
| 103 | +Name: "{commondesktop}\SageMath"; Filename: "{#bin}\mintty.exe"; Parameters: "-t SageMath -i sagemath.ico {#RunSage}"; WorkingDir: "{app}"; Comment: "{#RunSageDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: desktop |
| 104 | + |
| 105 | +Name: "{app}\SageMath Shell"; Filename: "{#bin}\mintty.exe"; Parameters: "-t 'SageMath Shell' -i sagemath.ico {#RunSageSh}"; WorkingDir: "{app}"; Comment: "{#RunSageShDoc}"; IconFilename: "{app}\sagemath.ico" |
| 106 | +Name: "{group}\SageMath Shell"; Filename: "{#bin}\mintty.exe"; Parameters: "-t 'SageMath Shell' -i sagemath.ico {#RunSageSh}"; WorkingDir: "{app}"; Comment: "{#RunSageShDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: startmenu |
| 107 | +Name: "{commondesktop}\SageMath Shell"; Filename: "{#bin}\mintty.exe"; Parameters: "-t SageMath -i sagemath.ico {#RunSageSh}"; WorkingDir: "{app}"; Comment: "{#RunSageShDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: desktop |
| 108 | + |
| 109 | +Name: "{app}\SageMath Notebook"; Filename: "{#bin}\mintty.exe"; Parameters: "-t 'SageMath Shell' -i sagemath.ico {#RunSageNotebook}"; WorkingDir: "{app}"; Comment: "{#RunSageNotebookDoc}"; IconFilename: "{app}\sagemath.ico" |
| 110 | +Name: "{group}\SageMath Notebook"; Filename: "{#bin}\mintty.exe"; Parameters: "-t 'SageMath Shell' -i sagemath.ico {#RunSageNotebook}"; WorkingDir: "{app}"; Comment: "{#RunSageNotebookDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: startmenu |
| 111 | +Name: "{commondesktop}\SageMath Notebook"; Filename: "{#bin}\mintty.exe"; Parameters: "-t SageMath -i sagemath.ico {#RunSageNotebook}"; WorkingDir: "{app}"; Comment: "{#RunSageNotebookDoc}"; IconFilename: "{app}\sagemath.ico"; Tasks: desktop |
| 112 | + |
| 113 | +[Code] |
| 114 | +procedure FixupSymlinks(); |
| 115 | +var |
| 116 | + n: Integer; |
| 117 | + i: Integer; |
| 118 | + resultCode: Integer; |
| 119 | + filenames: TArrayOfString; |
| 120 | + filenam: String; |
| 121 | +begin |
| 122 | + LoadStringsFromFile(ExpandConstant('{app}\app\etc\symlinks.lst'), filenames); |
| 123 | + n := GetArrayLength(filenames); |
| 124 | + WizardForm.ProgressGauge.Min := 0; |
| 125 | + WizardForm.ProgressGauge.Max := n - 1; |
| 126 | + WizardForm.ProgressGauge.Position := 0; |
| 127 | + WizardForm.StatusLabel.Caption := 'Fixing up symlinks...'; |
| 128 | + for i := 0 to n - 1 do |
| 129 | + begin |
| 130 | + filenam := filenames[i]; |
| 131 | + WizardForm.FilenameLabel.Caption := Copy(filenam, 2, Length(filenam)); |
| 132 | + WizardForm.ProgressGauge.Position := i; |
| 133 | + Exec(ExpandConstant('{sys}\attrib.exe'), '+S ' + filenam, |
| 134 | + ExpandConstant('{app}\app'), SW_HIDE, |
| 135 | + ewNoWait, resultCode); |
| 136 | + end; |
| 137 | +end; |
0 commit comments