Skip to content

Commit d889fc8

Browse files
committed
Trying to fix the installer for Mathematica <=11.2
1 parent e8552f5 commit d889fc8

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

FunKitInstaller.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
Abort[];
2727
];
2828

29-
(* just for backwards compatibility *)
30-
If[ToString[Context[URLDownload]]=!="System`",
31-
URLDownload=URLSave
32-
];
33-
34-
3529
(* ::Input::Initialization:: *)
3630
FunKitZipLocation="https://github.com/satfra/FunKit/archive/refs/heads/main.zip";
3731
FunKitInstallDir=FileNameJoin[{$UserBaseDirectory,"Applications"}];
@@ -43,7 +37,16 @@
4337

4438
Print["Downloading FunKit ..."];
4539
FunKitArchive=FileNameJoin[{$TemporaryDirectory,"FunKit.zip"}];
46-
URLDownload[FunKitZipLocation,FunKitArchive]
40+
If[$VersionNumber >= 11.2,
41+
URLDownload[FunKitZipLocation, FunKitArchive],
42+
Module[{data},
43+
data = Quiet[Import[FunKitZipLocation, "Byte"]];
44+
If[ListQ[data] && Length[data] > 0,
45+
Close[BinaryWrite[OpenWrite[FunKitArchive, BinaryFormat -> True], data]],
46+
Message[FunKitInstaller::zipdownloadfailed]; Abort[]
47+
]
48+
]
49+
]
4750

4851
tmpFunKitImport=Import[FunKitArchive];
4952
If[tmpFunKitImport==="{\"error\":\"Not Found\"}"||tmpFunKitImport==="404: Not Found",

0 commit comments

Comments
 (0)