Skip to content

Commit

Permalink
better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
goswinr committed Jan 18, 2025
1 parent 08d3ed9 commit 61301be
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 73 deletions.
14 changes: 8 additions & 6 deletions .github/InstallNotes-net48.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ To install just download and run `Fesh.net48-framework-Setup.exe` from the Asset

No admin rights are required to install or run the app.
The app will be installed in `C:\Users\{username}\AppData\Local\Fesh.net48\current`.\
A shortcut will be created on the desktop.\
A shortcut will be created on the desktop.
It will automatically offer to update Fesh when a new version is available.

There is also a portable package `Fesh.net48-framework-Portable.zip`.\
Extract that zip and place it wherever you'd like.\
It has identical functionality to the installer.\
It will also automatically offer to update itself when a new version is available.

It will automatically suggest to update Fesh when a new version is released.\
The installer is digitally code-signed via Azure Trusted Signing Service.\
It should not raise any security warnings.

There is also a portable package `Fesh.net48-framework-Portable.zip` which does not need to be installed and is self-updating.\
Feel free to extract your app from that zip and place it wherever you'd like.

See the [Changelog](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md) for changes in this release
See the [Changelog](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md) for changes in this release.

This release was created with [Velopack](https://velopack.io/).

Expand Down
14 changes: 9 additions & 5 deletions .github/InstallNotes-net9.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ To install just download and run `Fesh-net9-Setup.exe` from the Assets.

No admin rights are required to install or run the app.
The app will be installed in `C:\Users\{username}\AppData\Local\Fesh\current`.\
A shortcut will be created on the desktop.\
A shortcut will be created on the desktop.
It will automatically offer to update Fesh when a new version is available.

There is also a portable package `Fesh-net9-Portable.zip`.\
Extract that zip and place it wherever you'd like.\
It has identical functionality to the installer.\
It will also automatically offer to update itself when a new version is available.

It will automatically suggest to update Fesh when a new version is released.\
The installer is digitally code-signed via Azure Trusted Signing Service.\
It should not raise any security warnings.

There is also a portable package `Fesh-net9-Portable.zip` which does not need to be installed and is self-updating.\
Feel free to extract your app from that zip and place it wherever you'd like.
See the [Changelog](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md) for changes in this release.

See the [Changelog](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md) for changes in this release
This release was created with [Velopack](https://velopack.io/).

</details>
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.20.0] - 2025-01-18
### Changed
- for portable version the location of SettingsFolder is inside the app folder now
- update to latest FSharp.Compiler.Service
- improved Readme and error messages

## [0.19.0] - 2025-01-12
### Changed
- create a Velopack installer
Expand Down
22 changes: 22 additions & 0 deletions Fesh.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FeshStandalone", "FeshStandalone.fsproj", "{5502E9D8-62C4-45F8-B230-53006A4B60B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5502E9D8-62C4-45F8-B230-53006A4B60B1}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{5502E9D8-62C4-45F8-B230-53006A4B60B1}.Debug|Any CPU.Build.0 = Release|Any CPU
{5502E9D8-62C4-45F8-B230-53006A4B60B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5502E9D8-62C4-45F8-B230-53006A4B60B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions FeshHosting.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<!-- <Version>0.14.2</Version> done by Ionide.KeepAChangelog.Tasks -->

<Authors>GoswinR</Authors>
<Authors>Goswin Rothenthal</Authors>
<Copyright>Goswin Rothenthal 2019</Copyright>
<Description>A hostable fsharp scripting editor for Windows based on Avalonedit</Description>
<ApplicationIcon>Media/logo.ico</ApplicationIcon>
Expand Down Expand Up @@ -142,7 +142,7 @@

</ItemGroup>

<Target Name="WriteChangelogVersion" AfterTargets="AfterBuild"> <!-- for version checks in github tag based builds -->
<Target Name="WriteChangelogVersion" AfterTargets="AfterBuild"> <!-- to check output from Ionide.KeepAChangelog.Tasks current git tag in gh actions -->
<WriteLinesToFile File="./bin/ChangelogVersion.txt" Lines="@(CurrentReleaseChangelog)" Overwrite="true" ContinueOnError="false" />
</Target>

Expand Down
5 changes: 3 additions & 2 deletions FeshStandalone.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- <Version>0.14.2</Version> taken from CHANGELOG.md by Ionide.KeepAChangelog.Tasks -->

<Company>Goswin Rothenthal</Company> <!-- <Company> shows up on file preview on fesh.exe in windows file explorer-->
<Authors>GoswinR</Authors>
<Authors>Goswin Rothenthal</Authors>
<Copyright>Goswin Rothenthal 2019</Copyright>
<Description>A hostable fsharp scripting editor for Windows based on Avalonedit</Description>
<ApplicationIcon>Media/logo.ico</ApplicationIcon>
Expand All @@ -56,7 +56,7 @@
<PackageReference Include="AvalonLog" Version="0.17.0" />

<!--this reference is needed for tooling only, it might not be installed on host PC. (running the .NET Framework version) see also https://github.com/fsprojects/IfSharp/issues/213 -->
<PackageReference Include="NETStandard.Library" Version="2.0.3" Condition="'$(TargetFramework)' == 'net472'" GeneratePathProperty="true" /> <!-- Generated PathProperty will be 'PkgNETStandard_Library' -->
<PackageReference Include="NETStandard.Library" Version="2.0.3" Condition="'$(TargetFramework)' == 'net48'" GeneratePathProperty="true" /> <!-- Generated PathProperty will be 'PkgNETStandard_Library' -->
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -131,6 +131,7 @@
</ItemGroup>

<Target Name="CopyFilesOverAfterBuild" BeforeTargets="AfterBuild">
<!-- to check output from Ionide.KeepAChangelog.Tasks current git tag in gh actions -->
<WriteLinesToFile File="./bin/ChangelogVersion.txt" Lines="@(CurrentReleaseChangelog)" Overwrite="true" ContinueOnError="false" />

<!--netstandard dll is needed for editor tooling only, copy it because it might not be installed on host PC . see also https://github.com/fsprojects/IfSharp/issues/213 -->
Expand Down
Binary file removed Media/screenshot1.png
Binary file not shown.
69 changes: 38 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ But it works standalone just as well.
![Screenshot](https://raw.githubusercontent.com/goswinr/Fesh/main/Media/screen2.png)

It is based on the excellent [AvalonEdit](https://github.com/goswinr/AvalonEditB), that is why it only works on Windows (for now).\
The editor supports F# 8.0 and has modern IDE features like semantic syntax highlighting, type-info and autocomplete.\
The editor supports F# 9.0 and has modern IDE features like semantic syntax highlighting, type-info and autocomplete.\
Unlike a typical F# REPL this editor has the input and the output in two separate windows.\
Just [like Don Syme always wanted it](https://github.com/dotnet/fsharp/issues/2161#issuecomment-270465310).\
You can even color the output with [Fescher](https://www.nuget.org/packages/Fesher).
Expand All @@ -33,26 +33,6 @@ But it is no longer available. So I created Fesh.
For hosting there is the nuget package [Fesh](https://www.nuget.org/packages/Fesh/). See hosting examples
[Fesh.Rhino](https://github.com/goswinr/Fesh.Rhino) and [Fesh.Revit](https://github.com/goswinr/Fesh.Revit).

## How to install

### Standalone

Build from the source with

```bash
dotnet build FeshStandalone.fsproj
```
or download the from [Releases](https://github.com/goswinr/Fesh/releases) to any location, **unblock** and run Fesh.exe.

### For hosting in another app
use the nuget package [Fesh](https://www.nuget.org/packages/Fesh/).\
Or, to build the Fesh nuget package run:

```bash
dotnet build FeshHosting.fsproj
```


## Features

### Syntax Highlighting
Expand Down Expand Up @@ -87,23 +67,50 @@ To enable ligatures set the font to `Cascadia Code`.\
You can change the font in the 'Settings.txt' file at `%APPDATA%\Local\Fesh\Settings\Standalone\Settings.txt`.\
Or via the menu: `About` -> `Open Settings Folder`.

### Changelog
see [CHANGELOG.md](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md)
## How to install the Standalone App

### Publishing
### Installer

or self contained:
The recommended way is to run the Setup.exe from [Releases](https://github.com/goswinr/Fesh/releases).\
Fesh will automatically offer to update itself when a new version is available.\
There is a .NET 9 and a .NET 4.8 version. Apart from the runtime they are the same.

The installer is created with [Velopack](https://velopack.io) and digitally signed.

No admin rights are required to install or run the app.\
The app will be installed in `\AppData\Local\Fesh`.\
A shortcut will be created on the desktop.

There is also a portable package in each release.\
Extract that zip and place it wherever you'd like.\
It has identical functionality to the installed app,\
but keeps it's Settings folder in the same directory.\
There is a ".portable" file in the folder to indicate that.\
It will also automatically offer to update itself when a new version is available.


### Build from source

Build from the source with:

```bash
dotnet publish FeshStandalone.fsproj -c release -r win-x64 -o bin/publish/net9 --framework net9.0-windows --self-contained
dotnet publish FeshStandalone.fsproj -c release -r win-x64 -o bin/publish/net9 --framework net9.0-windows
dotnet publish FeshStandalone.fsproj -c release -r win-x64 -o bin/publish/net48 --framework net48
dotnet build FeshStandalone.fsproj
```
You will still get notifications about new releases, but you have to install them manually.

the use [Velopack](https://docs.velopack.io/packaging/installer) to create an installer:

## How to host Fesh in another app

Use the nuget package [Fesh](https://www.nuget.org/packages/Fesh/).\
Or, to build the Fesh nuget package run:

```bash
vpk pack --packId Fesh --packVersion 0.15.1 --packDir bin/publish/net9 --outputDir bin/installer/net9 --mainExe Fesh.exe --framework net9.0-x64-desktop --icon Media/logo.ico
dotnet build FeshHosting.fsproj
```

https://docs.velopack.io/packaging/deltas#disabling-deltas

## Release Notes
For changes in each release see the [CHANGELOG.md](https://github.com/goswinr/Fesh/blob/main/CHANGELOG.md)

## License
Fesh is licensed under the [MIT License](LICENSE.md).
2 changes: 1 addition & 1 deletion Src/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module App =
[< STAThread >]
let runEditorStandalone (args: string []) : int =
VelopackApp.Build()
.SetAutoApplyOnStartup(false)
.SetAutoApplyOnStartup(false) // to not install updates even if they are downloaded
.Run() //https://docs.velopack.io/getting-started/csharp
let app = Application() // do first so that pack Uris work
let fesh = Initialize.everything (None, args)
Expand Down
63 changes: 37 additions & 26 deletions Src/Initialize.fs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module Initialize =
if config.RunContext.IsStandalone then
async {
try
let cv = Reflection.Assembly.GetAssembly(typeof<Config>).GetName().Version.ToString()
let ass = Reflection.Assembly.GetAssembly(typeof<Config>)
let cv = ass.GetName().Version.ToString()
let cv = if cv.EndsWith(".0") then cv[..^2] else cv
// The GitHub access token to use with the request to download releases.
// If left empty, the GitHub rate limit for unauthenticated requests allows for up to 60 requests per hour, limited by IP address.
Expand All @@ -62,31 +63,41 @@ module Initialize =
| updateInfo ->
IFeshLog.log.PrintfnInfoMsg "Update for Fesh available."
let nv = updateInfo.TargetFullRelease.Version.ToString()
do! Async.SwitchToContext Fittings.SyncWpf.context
match MessageBox.Show(
fesh.Window,
$"Update Fesh from {cv} to {nv} and restart? Changes are saved.",
"Fesh Updates available!",
MessageBoxButton.YesNo,
MessageBoxImage.Question,
MessageBoxResult.Yes, // default result
MessageBoxOptions.None) with
| MessageBoxResult.No ->
IFeshLog.log.PrintfnInfoMsg "Updating Fesh was skipped."
| MessageBoxResult.Yes ->
// if fesh.Tabs.AllTabs |> Seq.map (fun t -> fesh.Tabs.Save(t)) |> Seq.forall id then // save needs to be in sync
if fesh.Tabs.AskForFileSavingToKnowIfClosingWindowIsOk() then // save needs to be in sync
do! Async.SwitchToThreadPool()
IFeshLog.log.PrintfnInfoMsg "All changes saved. Proceeding with update ..."
IFeshLog.log.PrintfnInfoMsg "Downloading Updates for Fesh ..."
updateManager.DownloadUpdatesAsync(updateInfo).Wait()
IFeshLog.log.PrintfnInfoMsg "Restarting Fesh to apply updates ..."
updateManager.ApplyUpdatesAndRestart(updateInfo)
IFeshLog.log.PrintfnInfoMsg "Updates for Fesh applied. Please restart the application."
else
IFeshLog.log.PrintfnIOErrorMsg "Some changes could not be saved. Update of Fesh cancelled."
| _ ->
IFeshLog.log.PrintfnInfoMsg "Unknown result from MessageBox.Show"
let exe = ass.Location
let exeFolder = Path.GetDirectoryName(exe)
let parentFolder = Path.GetDirectoryName(exeFolder)
let updater = Path.Combine(parentFolder, "Update.exe")
if not (IO.File.Exists(updater)) then
// this is expected when running a local build of Fesh not packaged with Velopack
IFeshLog.log.PrintfnIOErrorMsg $"A newer version of Fesh is available: {nv} , you are using {cv}"
IFeshLog.log.PrintfnIOErrorMsg "Automattic updates are not available because Update.exe was not found in the parent folder."
IFeshLog.log.PrintfnIOErrorMsg "Please re-install from https://github.com/goswinr/Fesh/releases"
else
do! Async.SwitchToContext Fittings.SyncWpf.context
match MessageBox.Show(
fesh.Window,
$"Update Fesh from {cv} to {nv} and restart? Changes are saved.",
"Fesh Updates available!",
MessageBoxButton.YesNo,
MessageBoxImage.Question,
MessageBoxResult.Yes, // default result
MessageBoxOptions.None) with
| MessageBoxResult.No ->
IFeshLog.log.PrintfnInfoMsg "Updating Fesh was skipped."
| MessageBoxResult.Yes ->
// if fesh.Tabs.AllTabs |> Seq.map (fun t -> fesh.Tabs.Save(t)) |> Seq.forall id then // save needs to be in sync
if fesh.Tabs.AskForFileSavingToKnowIfClosingWindowIsOk() then // save needs to be in sync
do! Async.SwitchToThreadPool()
IFeshLog.log.PrintfnInfoMsg "All changes saved. Proceeding with update ..."
IFeshLog.log.PrintfnInfoMsg "Downloading Updates for Fesh ..."
do! Async.AwaitTask (updateManager.DownloadUpdatesAsync(updateInfo))
IFeshLog.log.PrintfnInfoMsg "Restarting Fesh to apply updates ..."
updateManager.ApplyUpdatesAndRestart(updateInfo)
IFeshLog.log.PrintfnInfoMsg "Updates for Fesh applied. Please restart the application."
else
IFeshLog.log.PrintfnIOErrorMsg "Some changes could not be saved. Update of Fesh cancelled."
| r ->
IFeshLog.log.PrintfnInfoMsg $"Fesh Updates available, Unknown result from MessageBox.Show: {r}"
with e ->
IFeshLog.log.PrintfnInfoMsg "Could not check for Velopack updates: %A" e
} |> Async.Start
Expand Down

0 comments on commit 61301be

Please sign in to comment.