Git Product home page Git Product logo

juliawin's Introduction

Hi there πŸ‘‹

  • My research is in Probabilistic Graphical Models
  • I'm with Stellenbosch University
  • I like learning performance-focused programming languages like Julia and Zig
  • ⚑ Fun fact: we are all time travellers with a jump speed of 1s/s

juliawin's People

Contributors

example123 avatar heetbeet avatar yazgoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

el-oso lodewykk

juliawin's Issues

Add md5 hash check support, and continue-with-installer

Add an option to "continue with installation" (at the user's own risk) if the installation failed.

We will have to implement some kind of md5 hash check to make sure the files downloaded to the temp directory are still the required files.
It will save some time on re-running a failed script. Unfortunately the packages will still be downloaded one-by-one.

Try again for failed download links

We can start by doing Julia's download implementation (currently it's downloading the atom and visual studio code binaries). We can do the Python/bat implementation later, cause failing early is not that bad compared to failing late in the install script.

Interface for multiple selection

I think I want to go for the "edit in text editor" approach. It seems to scale well and is quite user friendly. In linux this will be nano (or vim, maybe, hmmmm), and in windows the only default is unfortunately notepad.

Here is some code to open notepad and wait for exit:

SETLOCAL
@echo off

::start notepad
for /f "tokens=2 delims==; " %%a in (' wmic process call create "notepad.exe" ^| find "ProcessId" ') do set PID=%%a

::wait until closed
:waitloop
TASKLIST | findstr "notepad.exe.*%PID%.*" >nul 2>&1
IF "%ERRORLEVEL%" EQU "0" (
    REM timeout /t 1 /n
    GOTO waitloop )
:loopdone

echo done with notepad
pause

Add Fully Portable Flavor

It will be even more portable if the launchers will define the set of System Variables: ALLUSERSPROFILE, APPDATA, HOMEPATH, ProgramData, USERPROFILE and JULIADOC.

Also, it will be nice to be able to set manually the name of the User Profile folder (Or maybe set its path).

VS Code User Data Folder

VS Code user data folder should be JuliaWin\userdata\.vscode\.
Yet in practice the settings.json file is updated at JuliaWin\packages\vscode\data\.

Make an equivalent Linux script

From https://www.reddit.com/r/Julia/comments/gbedwz/julia_windows_installation_script_with_batteries/fp7s8xl/

  • write python or bash code to replace the Windows .bat parts
  • get to the Julia part as fast as possible, and try to cross-platform generalise as much as poossible
  • maybe seperate the bat / julia / python code and allow the installer scripts to automatically get the julia part from github as a proper .jl file (added security issues).
  • get some bash glue going to replace the .bat entry points

This is a good template for the bash glue:

#--------------------------------------------------
# I might be a symlink, so here is my actual location
#--------------------------------------------------
#From https://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" 
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

#--------------------------------------------------
# Setup the environment variables and paths for Juliawin
#--------------------------------------------------
__environmentcode__

#--------------------------------------------------
# Finally, run this binary please
#--------------------------------------------------
"$DIR/__relativepathtobin__" "$@"

Installer stops during make_exe phase

User 43 minutes ago
I got an error from resource hacker ... is this normal?

User 43 minutes ago
ERROR: LoadError: IOError: open: no such file or directory (ENOENT)

Heetbeet 42 minutes ago
No that is not suppose to happen... hmm

User 42 minutes ago
it is still installing something ...

Heetbeet 41 minutes ago
It will probably install everything without the .exe launchers

User 40 minutes ago
ok, let me wait until it finishes

Heetbeet 40 minutes ago
How did you start the process? From the command-line?

User 40 minutes ago
yup

User 40 minutes ago
and removed Juno from the options

User 40 minutes ago
that's all I did

Heetbeet 39 minutes ago
Ah, okay, that might be it. I might have accidently not isolated the components well wnough.

Heetbeet 39 minutes ago
During my own testing, I never unchecked Juno, so that might be it.

User 38 minutes ago
ok, I got the error once more

User 38 minutes ago
and again ... not sure how to debug this ...

User 38 minutes ago
(I agree with you rant about batch)

Heetbeet 37 minutes ago
Okay, would you mind telling me what is in your folder:
C:\Users<user>\Juliawin\packages

User 37 minutes ago
maybe this error helps more

User 37 minutes ago
ERROR: LoadError: IOError: open: no such file or directory (ENOENT)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] open(::String, ::UInt16, ::Int64) at .\filesystem.jl:87
[3] open at .\filesystem.jl:79 [inlined]
[4] sendfile(::String, ::String) at .\file.jl:938
[5] cp(::String, ::String; force::Bool, follow_symlinks::Bool) at .\file.jl:351
[6] make_exe(::String, ::Bool, ::String) at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:187
[7] top-level scope at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:531
[8] include(::Function, ::Module, ::String) at .\Base.jl:380
[9] include(::Module, ::String) at .\Base.jl:368
[10] exec_options(::Base.JLOptions) at .\client.jl:296
[11] _start() at .\client.jl:506

Heetbeet 37 minutes ago
And in
C:\Users\simon\Juliawin\bin

User 36 minutes ago
checking ...

User 35 minutes ago
hmm ... how do I show you? ... I can't take screenshots ... :thinking_face:

User 35 minutes ago
well, curl, julia, resource_hacker seem to be there

User 34 minutes ago
vscode-x64 is empty

User 34 minutes ago
and this already finished

User 34 minutes ago
bin has 6 bat files

Heetbeet 33 minutes ago
Okay, I'll quickly see on my side what happens when I uncheck Juno.
πŸ‘
1

User 33 minutes ago
7z, curl,julia, juliawin-environment, pluto and ResourceHacker

User 33 minutes ago
also .. running normal user (not admin)

Heetbeet 32 minutes ago
None of this should require admin, luckily. Quicky run julia.bat to see what happens

User 31 minutes ago
it opens julia πŸ™‚ ...

Heetbeet 31 minutes ago
Thats a good start πŸ˜›

Heetbeet 30 minutes ago
I'm quickly trying to reproduce the error on my side.

Heetbeet 29 minutes ago
Do you have any exes in the base directory? Like on the picture I posted

User 29 minutes ago
unfortunately I am running this on my work laptop and can't extract much information

User 29 minutes ago
but I will try to help

User 29 minutes ago
no, no exes

Heetbeet 29 minutes ago
And does C:\Users\simon\Juliawin\bin\ResourceHacker.bat work?

Heetbeet 28 minutes ago
"and can't extract much information" no worries I won't ask anything info outside that directory

User 28 minutes ago
not sure what it is suppose to do, but it popped up a window that says Resource Hacker πŸ™‚

Heetbeet 27 minutes ago
Like this?
image.png
image.png

User 27 minutes ago
yes, I that's fine ... my point is that I can't take screenshots and copy too much text

User 27 minutes ago
yup, like that

User 27 minutes ago
not sure what that is though

Heetbeet 25 minutes ago
That is the program that creates the entry-point exe's

User 25 minutes ago
when I got the Error several line numbers from julia-win-installer.jl were reported

User 25 minutes ago
perhaps those are useful to troubleshoot

User 24 minutes ago
from the top ...

User 24 minutes ago
[6] make_exe(::String, ::Bool, ::Nothing) at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:187
[7] top-level scope at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:421

User 24 minutes ago
[6] make_exe(::String, ::Bool, ::String) at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:187
[7] top-level scope at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:531

User 23 minutes ago
[9] top-level scope at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:589
[10] include(::Function, ::Module, ::String) at .\Base.jl:380
[11] include(::Module, ::String) at .\Base.jl:368
[12] exec_options(::Base.JLOptions) at .\client.jl:296
[13] _start() at .\client.jl:506
in expression starting at C:\Users\User\AppData\Local\Temp\juliawin\src\julia-win-installer.jl:572
() End of installation

User 22 minutes ago
ALL of them have these 5 lines in common

User 22 minutes ago
ERROR: LoadError: IOError: open: no such file or directory (ENOENT)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] open(::String, ::UInt16, ::Int64) at .\filesystem.jl:87
[3] open at .\filesystem.jl:79 [inlined]
[4] sendfile(::String, ::String) at .\file.jl:938
[5] cp(::String, ::String; force::Bool, follow_symlinks::Bool) at .\file.jl:351

Heetbeet 22 minutes ago
I think the downloader didn't grab the assets needed for creating the entry-points:
https://github.com/heetbeet/juliawin/tree/master/assets

User 21 minutes ago
probably ... despite working at home, my laptop has some rules to block connections

User 20 minutes ago
well ... those assets are on the clone that I grabbed

Heetbeet 20 minutes ago
it probably failed to call this routine

:DOWNLOAD-FROM-GITHUB-DIRECTORY <githublink> <destdir>

User 16 minutes ago
not 100% sure, but it seems that it worked

User 15 minutes ago
[E]dit: choose my own settings
[D]efault: use default settings
[C]ancel: cancel the installation
Edit default settings for C:\Users\User\Juliawin [E/D/C]? e
Please edit your selection in Notepad
() Downloading https://github.com/heetbeet/juliawin/tree/master/assets to C:\Users\User\AppData\Local\Temp\juli
awin\assets
() Configuring the download source
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162 100 162 0 0 162 0 0:00:01 --:--:-- 0:00:01 369
100 19325 100 19325 0 0 19325 0 0:00:01 --:--:-- 0:00:01 19325
() Download https://julialang-s3.julialang.org/bin/winnt/x64/1.5/julia-1.5.3-win64.exe to
() C:\Users\User\AppData\Local\Temp\juliawin\julia-1.5.3-win64.exe
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 67.5M 100 67.5M 0 0 6916k 0 0:00:10 0:00:10 --:--:-- 6349k
() Extracting into C:\Users\User\Juliawin\packages\julia-1.5.3-win64
_
_ _ ()_ | Documentation: https://docs.julialang.org

Heetbeet 15 minutes ago
Did you run this from a cloned repo? Or did you run it from the installation guide:
cmd /c "powershell -c "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/heetbeet/juliawin/master/juliawin-bootstrap.bat','%tmp%\jw.bat');" & "%tmp%\jw.bat""

User 14 minutes ago
from a cloned repo ... was that wrong? :face_with_rolling_eyes:

Heetbeet 13 minutes ago
It shouldn't be wrong I just didn't test it that way in a long time.

Heetbeet 12 minutes ago
If you don't mind doing me a big favor. What happens if you run it directly from this command?
cmd /c "powershell -c "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/heetbeet/juliawin/master/juliawin-bootstrap.bat','%tmp%\jw.bat');" & "%tmp%\jw.bat""

User 12 minutes ago
ok, I guess that the "right way" should be running this line cmd /c "powershell -c "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/heetbeet/juliawin/master/juliawin-bootstrap.bat','%tmp%\jw.bat');" & "%tmp%\jw.bat""

Heetbeet 11 minutes ago
Yes, the current right way

User 11 minutes ago
ok, let me try again

Heetbeet 10 minutes ago
Sorry for bothering you so much, but al of this this is quite some good usage information

User 10 minutes ago
no, no, don't worry!

User 10 minutes ago
I also want this for my own selfish purposes πŸ˜„

User 9 minutes ago
nope, same error ...

Exe launcher for julia-vscode cannot run on some computers

User 2 hours ago
thanks!

User 2 hours ago
julia.exe and pluto.exe, but vscode.exe complains ... although the .bat works

User 2 hours ago
I can work with that πŸ™‚

Heetbeet 2 hours ago
what is the error for vscode.exe?

User 2 hours ago
Windows cannot access the specified device, path, or files. You may not have the appropriate permissions to access the item. (edited)

Heetbeet 2 hours ago
Ah interesting. I wonder if it has something to do with privileges? It's good to know that the bat works at least

User 2 hours ago
I also don't know but it might

Heetbeet 2 hours ago
what happens when you set this as the first line in your bin\julia-vscode.bat file:
set __COMPAT_LAYER=RunAsInvoker

Heetbeet 2 hours ago
does the julia-vscode.exe run then?

User 2 hours ago
it took longer, but same error

Heetbeet 2 hours ago
quickly rename the julia-vscode.exe to code-cli.exe

Heetbeet 2 hours ago
and run code-cli.exe

User 2 hours ago
same error

Heetbeet 2 hours ago
quicky rename pluto.exe to julia-vscode.exe and see if you can run that (the exe files read their own name as a way to dispatch to the bat files)

Heetbeet 2 hours ago
(so there might be a very small change that that one exe file is broken some how)

User 2 hours ago
how can I regenerate the exe? the .bat file works

User 2 hours ago
but the exe doesn't

User 2 hours ago
good idea

User 2 hours ago
nope, same thing

Heetbeet 2 hours ago
So for some reason windows doesn't like the fact that the exe calls the bat file (or the bat file calls code.exe )

Heetbeet 2 hours ago
You are not allowed to make calls to powershell right?

User 2 hours ago
well ... I can ... but those are usually tracked

User 1 hour ago
and if the cybersecurity team sees something out of the ordinary then they contact me

Heetbeet 1 hour ago
Throw this in your bin directory
content is:
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
& $scriptPath/Code.bat
code-ps.ps1
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
& $scriptPath/Code.bat

Heetbeet 1 hour ago
make sure it is in bin\code-ps.ps1

Heetbeet 1 hour ago
then rename one of the exes to code-ps.exe

Heetbeet 1 hour ago
and see it it runs

Heetbeet 1 hour ago
(those exes check for any of the following extensions: .cmd, .bat, .ps1, .vbs and then runs it)

User 1 hour ago
nope, same error

Heetbeet 1 hour ago
try with the vbs file
code-vbs.vbs
scriptdir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
codebat = scriptdir & "\Code.bat"
​
​
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run """" & codebat & """", 0, True
Collapse

User 1 hour ago
The vbs script by itself complains about an invalid character

User 1 hour ago
oh wait ... nevermind

User 1 hour ago
nope, the exe doesn't work

User 1 hour ago
don't sweat it ... let it rest and perhaps you get an idea at another time

Heetbeet 1 hour ago
and if you go to the bin folder and double-click the vbs script directly for comparison

User 1 hour ago
I'm not very experiences with these windows things, but will also try to investigate a bit

User 1 hour ago
before testing all the .exe with modifications, I first tested the script themselves

User 1 hour ago
by themselves all of them work

User 1 hour ago
it's just the .exe wrapper that gives trouble

Heetbeet 1 hour ago
Windows is notorious for having strange edge-case behaviour. Even filenames have an effect on privileges (it picks up names like setup and install etc.).

Heetbeet 1 hour ago
But okay, I'm quite out of ideas in any case.

User 1 hour ago
now worries, this is already great!

Add JuliaMono as default font in VSCode

The idea is to download JuliaMono from: https://github.com/cormullion/juliamono/blob/master/juliamono-ttf.zip and add the .ttfs to packages\fonts.

Then before any VSCode launch, the following code can be adapted and run to ensure all fonts are temporary available to the system https://gist.github.com/Jaykul/d53a16ce5e7d50b13530acb4f98aaabd , for eg bin/activate-juliawin-fonts.ps1 with content:

add-type -name Session -namespace "" -member @"
[DllImport("gdi32.dll")]
public static extern int AddFontResource(string filePath);
"@

$null = foreach($font in Get-ChildItem -Path "$juliawin_packages\fonts" -Recurse -Include *.ttf, *.otg) {
    [Session]::AddFontResource($font.FullName)
}

On the VSCode side we should add JuliaMono in the font setting, (over here, https://github.com/heetbeet/juliawin/blob/main/userdata/.vscode/data/user-data/User/settings.json ), similarly to this guide https://dev.to/thegeoffstevens/vs-code-settings-you-should-customize-5e75 but replacing Fira with Juliamono:

"editor.fontFamily": "Fira Code"
"editor.fontLigatures": true

Juliawin cannot be relocated

The system images and compiled libraries currently breaks when relocating. This is due to compiled code holding on to old file locations. Solution is to delete compiled packages every time Juliawin relocated.

One example:

julia> using PyCall
[ Info: Precompiling PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0]
ERROR: LoadError: ArgumentError: Path to conda environment is not valid: C:\Users\Foo\Documents\julia\repositories\juliawin\packages\conda

Add releases as pre-baked exe installers.

It might be worth while to add an offline .exe installer with some pre-baked files and under defaults settings. This will be quite an undertaking to automate though.

Add linux version

Currently everything is windows specific and written in batch. Adding a linux (specifically debian/ ubuntu) version would entail writing all the glue in bash. This might actually be easier than expected, since most of the work was figuring out how to set up the whole environment.

What needs to happen

  • Write bootstrappers in bash
  • Write linux targeted versions of the install functions in internals
  • Write bash wrappers over the internal applications
  • Create .desktop launchers for pretty icon integration

How is juno-uber installed? Is access to atom.io needed with the thin installer.

First of all, this package is great and very useful!

My collaborator is behind a firewall, and I will recommend him to use juliawin.

I wanted to ask which URL's the thin installer accesses? Only GitHub files or also external URLs?
(Depending on that I would recommend my collaborator the full or thin installer).

PS: This is not really an issue. But I didn't know where to ask.

Needs updating (because of security issue)

Julia 1.7.0 is out so that's one reason. It and recent 1.6.x also fix a security issue, so I would advice no one to use that old a version as this portable Julia is currently.

Rethinking Juliawin

Problematic aspects of Juliawin

  • Currently releasing Juliawin from my home computer is not sustainable or auditable (from a security standpoint).
  • Also, Juliawin needs to find a way to become somewhat cross-platform. My initial tests in https://github.com/heetbeet/juliawin/tree/moving-over-to-bash-centric-environment seems like the best way to go cross platform is to move all the glue over to bash, and to add GitSCM as a hard dependency for windows users (not ideal though, since GitSCM adds ~50mb dependencies).
  • The code for Juliawin is a spaghetti mess with a mixture of both downloading and setting up the environment, making entry points to the portable applications, and doing portability cleaning and environment fixing. We need to fix this situation

Rethinking the model

I'm playing around with Github Actions and the following pipeline needs to be set up in order for this product to survive and not require constant maintenance:

Actionables

  • Remove all code that downloads external artifacts and move this over to a Github Action build step
  • Maybe zip and keep a Github link for each program in packages/<program> so that you can retrieve it externally as dependencies when we want to
  • Maybe add a simple commandline tool to do simple feature installations and removals
    • e.g. juliawin install [vscode/pluto/pycall/ijulia]
    • e.g. juliawin remove [vscode/pluto/pycall/ijulia]
    • e.g. juliawin upgrade [vscode/pluto/pycall/ijulia]
    • e.g. juliawin force-julia-version 1.6.3
  • While we are inventing the wheel, we should probably just use julia from https://github.com/JuliaLang/juliaup to get all the julia versioning features
  • Maybe use instruction configurations like a pluto.yaml or a vscode.yaml to do the feature installation dirty work (how do others do it?), add things like
    • Entry point wrappers + their icons
    • Code that needs to be run to install the feature and all it's dependencies
  • Build a mechanism that can move the original packages/julia to packages/julia_backup and use it as a fallback when juliawin force-julia-version fails (do this only for the original julia that come with the original installer)
  • Build ready made installers that have made a few feature choices on your behalf: steal everything useful to create exe installers from https://github.com/heetbeet/juliawin-create-releases/blob/main/scripts/make_release_from_scratch.py and chuck the rest
  • Let this pipeline flow into Juliawin release cycle

Take away

  • Juliawin started as a script that can be run on Windows without any dependencies and do all the downloading, unpacking and glueing together on the user's behalf.
  • This model is very flawed and not ideal, you want everything that can go wrong be vetted in the build process, and give the user a clean installer to get things started.
  • We gradually moved over to providing installers, but the code for generating these installers is a complete manual mess: https://github.com/heetbeet/juliawin-create-releases
  • We should focus on being as lazy as possible for our implementation, use other good well-vetted projects like chocolatey, GithubActions, juliaup etc. to do the heavy lifting.

Add julia daemon launcher using DaemonMode.jl

Create a julia-daemon.exe launcher with the following characteristics:

  • julia-daemon.exe should be similar in nature to julia.exe
  • on first run (e.g. julia-daemon foo.jl) it will start the daemon and run the passes arguments
  • on consecutive runs, it will use the open daemon to run the next part

(related dmolina/DaemonMode.jl#13)

Add small amount of other userful packages

Hey!

Would it be possible to add some other nearly fundamental packages to a juliawin version. Most importantly are LinearAlgebra, Dataframes , Plots, and perhaps PyCall.

I know this could be an endless line of requests, but juliawin fits a perfect niche. For those that cannot use the julia package manager on an offline computer.

Better Pluto.jl behaviour

It's nice to have pluto.exe, but I think we can do even better:

  • Allow pluto.exe to detect if Pluto is already running, and first try to open previous instance in new tab than to launch new instance. It might be too difficult to get this working with the secret code.
  • Make a new .exe called pluto-or-julia.exe that first detects if the file is a pluto notebook, and then either run the file through Pluto or through Julia. This will allow file association open .jl files with the correct program.

Add pretty icons for Windows

The following NSIS pipeline produces atom.exe

import textwrap
import subprocess


nsis_txt = textwrap.dedent(r"""
/* WinPython launcher template script
Copyright Β© 2012 Pierre Raybaut
Licensed under the terms of the MIT License
(see winpython/__init__.py for details)
*/
;================================================================
; These lines are automatically filled when winpython/make.py creates launchers:
!addincludedir ""
!define COMMAND __command__
!define PARAMETERS __parameters__
!define WORKDIR ""
;!define Icon ""
!define OutFile __outfile__
;================================================================
# Standard NSIS plugins
!include "WordFunc.nsh"
!include "FileFunc.nsh"

SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow
RequestExecutionLevel user

Section ""
Call Execute
SectionEnd

Function Execute
;Set working Directory ===========================
StrCmp ${WORKDIR} "" 0 workdir
System::Call "kernel32::GetCurrentDirectory(i ${NSIS_MAX_STRLEN}, t .r0)"
SetOutPath $0
Goto end_workdir
workdir:
SetOutPath "${WORKDIR}"
end_workdir:
;Get Command line parameters =====================
${GetParameters} $R1
StrCmp "${PARAMETERS}" "" end_param 0
StrCpy $R1 "${PARAMETERS} $R1"
end_param:
;===== Execution =================================
Exec '"${COMMAND}" $R1'
FunctionEnd
"""
)

#%%
data = [('__command__', "wscript.exe"),
        ('__parameters__', r"scripts\noshell.vbs scripts\atom.bat"),
        ('__outfile__', "atom.exe")]

for fnd, repl in data:
    nsis_txt = nsis_txt.replace(fnd, f'"{repl}"')

                
with open("atom.nsi", "w") as f:
    f.write(nsis_txt)

subprocess.call(r'makensis.exe -V2 "atom.nsi"')

Julia doesn't work on Windows 7 SP1 out-of-the-box

I'm setting up a test-box to ensure this script runs on a bare-bone system, but Julia's package manager doesn't work on the system. It doesn't seem to work on Julia's side of things. To get a good test-box up and running is enough reason for me to make it work though. (With an added benefit for restricted Windows 7 users.)

I had to tweak my script a little bit in order to get downloads working (I had to add curl as an dependency that gets triggered and downloaded on systems with an older powershell). But then Julia doesn't pick up this curl, since it only searches these paths for curl (good for security, bad for me): https://github.com/JuliaLang/julia/blob/a47cf0084575a8beba0d2eec1701cfc427af2056/base/download.jl#L29 .

I should add a less restricted find_curl to startup.jl if the installer finds that the user is running windows 7 with an old powershell:

Base.find_curl() =  function()
    if Sys.isapple() && Sys.isexecutable("/usr/bin/curl")
        "/usr/bin/curl"
    elseif Sys.iswindows() && Sys.isexecutable(joinpath(get(ENV, "SYSTEMROOT", "C:\\Windows"), "System32\\curl.exe"))
        joinpath(get(ENV, "SYSTEMROOT", "C:\\Windows"), "System32\\curl.exe")
    elseif Sys.iswindows() && Sys.which("curl") !== nothing
        Sys.which("curl") 
    elseif !Sys.iswindows() && Sys.which("curl") !== nothing
        "curl"
    else
        nothing
    end
end

https://discourse.julialang.org/t/what-is-in-your-startup-jl/18228

Edit: is also seems (will confirm later) that on windows julia wants the full extension to the executable in the windows path, so I changed that in the code above.

[Feature] Add Quatro CLI

The Quatro is:

Open source scientific and technical publishing system built on Pandoc.

It allows great Literate experience.
I will be great to add it to JuliaWin:

  1. It will be downloaded like a package.
  2. A CMD with Quarto and Julia in %PATH% for seamless work.

Error when trying to install on an external SSD

The installation fails when the directory is set to an external SSD. Please find below the terminal dump

Microsoft Windows [version 10.0.19042.1526]
(c) Microsoft Corporation. Tous droits rΓ©servΓ©s.

C:\Users\***>cmd /c "powershell -c "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/heetbeet/juliawin/main/bin/Juliawin Bootstrap From Github.bat','%tmp%\_.bat')" & "%tmp%\_.bat""
                _
    _       _ _(_)_           _        | Juliawin commandline installer
   | |     | (_) (_)         (_)       |
   | |_   _| |_  __ _ __   __ _ _ __   | GitHub.com/heetbeet/juliawin
   | | | | | | |/ _` |'/ _ \'| | '_ \  |
 __/ | |_| | | | (_| | \/ \/ | | | | | | Run with "/h" for help
|___/ \__'_|_|_|\__'_|\__/\_/|_|_| |_| |

() Download Juliawin installer from GitHub.com into temp
() Unzip juliawin to temp

  [Y]es: choose the default installation directory
  [N]o: cancel the installation
  [D]irectory: choose my own directory

Install to C:\Users\*****\Juliawin [Y/N/D]? D

Note: For a posix shell experience in Julia, you will need a MinGW installation.
If you have Git installed, you may skip MinGW installation.
If you are unsure, go ahead and mark MinGW for installation.

Install MinGW...
Yes, No, Reset questions [Y/N/R]? y

Install VSCode...
Yes, No, Reset questions [Y/N/R]? y

Install Juno...
Yes, No, Reset questions [Y/N/R]? n

Install Pluto...
Yes, No, Reset questions [Y/N/R]? n

Install PyCall...
Yes, No, Reset questions [Y/N/R]? n

Install Jupyter...
Yes, No, Reset questions [Y/N/R]? n

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    404      0 --:--:-- --:--:-- --:--:--   406
100 22463  100 22463    0     0  40391      0 --:--:-- --:--:-- --:--:-- 40391
() Got Julia link as https://julialang-s3.julialang.org/bin/winnt/x64/1.7/julia-1.7.2-win64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  127M  100  127M    0     0   765k      0  0:02:51  0:02:51 --:--:--  801k
() Extracting C:\Users\*****\AppData\Local\Temp\julia-bootstrap-download-3254332254\julia-1.7.2-win64.zip into "H:\Juliawin\packages\julia"
  Installing known registries into `H:\Juliawin\userdata\.julia`
    Updating registry at `H:\Juliawin\userdata\.julia\registries\General.toml`
   Resolving package versions...

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x281b7bb -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
in expression starting at H:\Juliawin\userdata\.julia\config\juliawinconfig.jl:6
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3206
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3758
jl_fs_chmod at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:383
#chmod#37 at .\file.jl:1113
chmod at .\file.jl:1113 [inlined]
set_readonly at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\utils.jl:50
macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\Pkg\src\Operations.jl:700 [inlined]
#45 at .\task.jl:423
jfptr_YY.45_60634.clone_1 at H:\Juliawin\packages\julia\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1788 [inlined]
start_task at /cygdrive/c/buildbot/worker/package_win64/build/src\task.c:877
Allocations: 2792706 (Pool: 2791033; Big: 1673); GC: 4

() End of Juliawin installation
Appuyez sur une touche pour continuer...

Commandline shenanigans

Technically, things like the following is legal in the commandline:
"""j"ulia"".exe
http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/

But we currently don't support it. Our dispatch exe is smart enough to separate the filepath from the rest of the commandline arguments, but it doesn't parse the filepath correctly:

//Remove quotes around filepath

This should be changed to remove all the quotes found within the filepath string, since there is no restriction on that the quotes should only be at the first and last occurrence of the pre-parsed path string.

Remove ugly (brackets.exe) files

The reason for these (weird-looking.exe) files is that I want to suppress executables (without deleting them) if the underlying support structure isn't installed. This is to bypass situations where (for instance) the Juliawin directory is added to window's path, and pluto is not installed, but a defunked pluto.exe is then available to the terminal.

The alternative would be to hide these (weird-looking.bat) and (weird-looking.exe) file somewhere else, and then only upon activating the exes/bats we move them to their correct location.

Julia REPL gets broken by our custom launcher

When evoking the REPL from a terminal window (as opposed to double-clicking the exe), the REPL is unstable. It sometimes jams the text and sometimes exit after a few seconds. My suspicion is that it has something to do with the .bat. I will first try to switch the Julia invoker over to use powershell, and then if it still fails see what can be wrong with the launchers.

Add version numbers and info to downloaded programs

The best would be to keep the references to those folders as dynamic as possible. Then you can replace the folders (like bump a version) without worrying too much about the surrounding glue:

@echo off
setlocal enabledelayedexpansion
::=================================================

call :EXPAND-FULLPATH juliahome "%~dp0../julia-*"
call :EXPAND-FULLPATH atomhome "%~dp0../atom-*"

::=================================================
goto :EOF

:EXPAND-FULLPATH <return> <filepath>
    ::basename with asterix expansion
    for /f "tokens=*" %%F in ('dir /b "%~2"') do set "_basename_=%%F"

    ::concatenate with dirname
    set "%~1=%~dp2%_basename_%"
goto :EOF

Add Pluto to Juliawin

For two reasons: (1) it's cool, (2) It can replace Jupyter and Jupyter's heavy dependencies.

Add a Launcher for VS Codium

VS Codium is a for of VS Code with disabled telemetry and open market.

It might be great to support it with a dedicated launcher.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.