├── src
├── Bootstrap
│ ├── 0install.exe.ignore
│ ├── chocolateyUninstall.ps1
│ ├── chocolateyInstall.ps1
│ ├── _Namespace.md
│ ├── Program.cs
│ ├── VERIFICATION.txt
│ ├── ConfigExtensions.cs
│ ├── CliBootstrapHandler.cs
│ ├── App.config
│ ├── IBootstrapHandler.cs
│ ├── Bootstrap.csproj
│ ├── Chocolatey.nuspec
│ ├── ExitCode.cs
│ └── BootstrapConfig.ini
├── Central.WinForms
│ ├── Logo_150.png
│ ├── Logo_70.png
│ ├── Resources
│ │ ├── AppAdded.png
│ │ ├── AppIcon.png
│ │ ├── ArrowUp.png
│ │ ├── ArrowDown.png
│ │ ├── ArrowRight.png
│ │ ├── AppCandidate.png
│ │ └── AppIntegrated.png
│ ├── _Namespace.md
│ ├── ZeroInstall.VisualElementsManifest.xml
│ ├── AppTileStatus.cs
│ ├── Properties
│ │ └── AppResources.cs
│ ├── MinimalTaskHandler.cs
│ ├── Program.cs
│ ├── CommandUtils.cs
│ ├── PortableCreatorDialog.cs
│ ├── Central.WinForms.csproj
│ ├── IntroDialog.zh.resx
│ ├── IntroDialog.ja.resx
│ ├── IntroDialog.ko.resx
│ ├── IntroDialog.fr.resx
│ ├── IntroDialog.el.resx
│ ├── IntroDialog.tr.resx
│ ├── IntroDialog.de.resx
│ ├── IntroDialog.it.resx
│ ├── IntroDialog.cs.resx
│ ├── IntroDialog.pt-BR.resx
│ ├── IntroDialog.id.resx
│ ├── IntroDialog.nl.resx
│ ├── IntroDialog.es.resx
│ ├── IntroDialog.pl.resx
│ ├── IntroDialog.ru.resx
│ ├── IntroDialog.ro.resx
│ ├── IntroDialog.pt-PT.resx
│ └── AppDropDown.cs
├── Bootstrap.WinForms
│ ├── SplashScreen.png
│ ├── Program.cs
│ ├── GlobalSuppressions.cs
│ ├── App.config
│ ├── zero-install.wsx
│ ├── GuiBootstrapHandler.cs
│ └── Bootstrap.WinForms.csproj
├── Alias.Cli
│ ├── _Namespace.md
│ ├── Program.cs
│ ├── Alias.Cli.csproj
│ └── GlobalSuppressions.cs
├── Launcher.Cli
│ ├── _Namespace.md
│ ├── Program.cs
│ └── Launcher.Cli.csproj
├── Store.Management.Cli
│ ├── _Namespace.md
│ ├── Program.cs
│ └── Store.Management.Cli.csproj
├── Store.Service
│ ├── _Namespace.md
│ ├── GlobalSuppressions.cs
│ ├── Program.cs
│ ├── StoreServiceInstaller.cs
│ ├── Store.Service.csproj
│ ├── app.manifest
│ ├── StoreService.Designer.cs
│ └── Properties
│ │ ├── Resources.zh.resx
│ │ ├── Resources.ko.resx
│ │ ├── Resources.ja.resx
│ │ ├── Resources.tr.resx
│ │ ├── Resources.pt-BR.resx
│ │ ├── Resources.id.resx
│ │ ├── Resources.cs.resx
│ │ ├── Resources.pl.resx
│ │ └── Resources.ru.resx
├── Commands.WinForms
│ ├── _Namespace.md
│ ├── Program.cs
│ ├── GlobalSuppressions.cs
│ ├── FormUtils.cs
│ ├── CommandUtils.cs
│ ├── GuiCommandHandler.Form.cs
│ ├── Commands.WinForms.csproj
│ ├── CacheNodeWithContextMenu.cs
│ └── FeedSearchDialog.cs
├── nuget.config
├── ZeroInstall.Windows.slnx
├── App.config
├── app.manifest
├── Directory.Build.props
└── build.ps1
├── icon.ico
├── icon.png
├── tests
├── search.ps1
├── store-audit.ps1
├── store-optimise.ps1
├── run.ps1
├── download.ps1
├── update.ps1
├── select.ps1
├── export.ps1
├── store-dirs.ps1
├── catalog.ps1
├── trust.ps1
├── config.ps1
├── desktop-integration.au3
├── feed-dirs.ps1
├── apps.ps1
├── store.ps1
└── desktop-integration.ps1
├── .gitattributes
├── .config
└── dotnet-tools.json
├── .gitignore
├── GitVersion.yml
├── renovate.json
├── 0install.ps1
├── appveyor.yml
├── .github
└── workflows
│ ├── translate-upload.yml
│ ├── translate.yml
│ └── release.yml
├── 0install.sh
├── 0install-win.xml.template
├── test.ps1
├── .tx
└── config
└── README.md
/src/Bootstrap/0install.exe.ignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/icon.ico
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/icon.png
--------------------------------------------------------------------------------
/tests/search.ps1:
--------------------------------------------------------------------------------
1 | 0install search vlc
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Disable linebreak normalization
2 | * -text
3 |
4 | # Language-aware diff
5 | *.cs diff=csharp
6 |
--------------------------------------------------------------------------------
/tests/store-audit.ps1:
--------------------------------------------------------------------------------
1 | 0install store audit
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
--------------------------------------------------------------------------------
/src/Central.WinForms/Logo_150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Logo_150.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Logo_70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Logo_70.png
--------------------------------------------------------------------------------
/src/Bootstrap.WinForms/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Bootstrap.WinForms/SplashScreen.png
--------------------------------------------------------------------------------
/src/Bootstrap/chocolateyUninstall.ps1:
--------------------------------------------------------------------------------
1 | 0install self remove --batch
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
--------------------------------------------------------------------------------
/src/Alias.Cli/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Alias.Cli
3 | summary: *content
4 | ---
5 | A shortcut for '0install add-alias'.
6 |
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/AppAdded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/AppAdded.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/AppIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/AppIcon.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/ArrowUp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/ArrowUp.png
--------------------------------------------------------------------------------
/src/Launcher.Cli/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Launcher.Cli
3 | summary: *content
4 | ---
5 | A shortcut for '0install run'.
6 |
--------------------------------------------------------------------------------
/tests/store-optimise.ps1:
--------------------------------------------------------------------------------
1 | 0install-win store optimise --batch | Out-Null
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/ArrowDown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/ArrowDown.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/ArrowRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/ArrowRight.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/AppCandidate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/AppCandidate.png
--------------------------------------------------------------------------------
/src/Central.WinForms/Resources/AppIntegrated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0install/0install-win/HEAD/src/Central.WinForms/Resources/AppIntegrated.png
--------------------------------------------------------------------------------
/src/Store.Management.Cli/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Store.Management.Cli
3 | summary: *content
4 | ---
5 | A shortcut for '0install store'.
6 |
--------------------------------------------------------------------------------
/tests/run.ps1:
--------------------------------------------------------------------------------
1 | 0install run https://apps.0install.net/devel/terraform.xml --help | Out-Null
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
--------------------------------------------------------------------------------
/tests/download.ps1:
--------------------------------------------------------------------------------
1 | 0install-win download --batch https://apps.0install.net/gui/naps2.xml | Out-Null
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
--------------------------------------------------------------------------------
/src/Bootstrap/chocolateyInstall.ps1:
--------------------------------------------------------------------------------
1 | . "$PSScriptRoot\0install.exe" --version=1.0.0-pre self deploy --machine --batch
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
--------------------------------------------------------------------------------
/src/Store.Service/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Store.Service
3 | summary: *content
4 | ---
5 | Windows service for managing a Zero Install implementation cache shared between all users.
6 |
--------------------------------------------------------------------------------
/tests/update.ps1:
--------------------------------------------------------------------------------
1 | 0install update --batch https://apps.0install.net/gui/notepad-plus-plus.xml | Out-Null
2 | if ((0, 1) -NotContains $LASTEXITCODE) {throw "Exit Code: $LASTEXITCODE"} # Expect OK or NoChanges
3 |
--------------------------------------------------------------------------------
/src/Bootstrap/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall
3 | summary: *content
4 | ---
5 | Code for bootstrapping Zero Install, i.e., downloading and running a full version of Zero Install using a small embedded version.
6 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Commands.WinForms
3 | summary: *content
4 | ---
5 | A WinForms-based GUI for Zero Install, for installing and launching applications, managing caches, etc..
6 |
--------------------------------------------------------------------------------
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "wix": {
6 | "version": "6.0.2",
7 | "commands": [
8 | "wix"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Bootstrap/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | ProgramUtils.Init();
5 |
6 | using var handler = new CliBootstrapHandler();
7 | return (int)ProgramUtils.Run(args, handler);
8 |
--------------------------------------------------------------------------------
/src/Central.WinForms/_Namespace.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: ZeroInstall.Central.WinForms
3 | summary: *content
4 | ---
5 | A WinForms-based GUI for Zero Install, for discovering and installing new applications, managing and launching installed applications, etc..
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.bak
3 | *.a.resx
4 | *.o.resx
5 |
6 | # Caches
7 | /src/.vs/
8 | /src/.idea/
9 | /src/_ReSharper.*/
10 | /src/*/obj/
11 | /src/*/bin/
12 |
13 | # Output
14 | /artifacts/
15 | /0install-win-*.xml
16 | /0install-win-*.tar.gz
17 |
18 | # Embedded content
19 | /src/Bootstrap/content/*
20 |
--------------------------------------------------------------------------------
/tests/select.ps1:
--------------------------------------------------------------------------------
1 | 0install select https://apps.0install.net/devel/terraform.xml
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
4 | $output = 0install list
5 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
6 | if ($output -NotContains "https://apps.0install.net/devel/terraform.xml") { throw "Wrong output" }
7 |
--------------------------------------------------------------------------------
/src/Central.WinForms/ZeroInstall.VisualElementsManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Launcher.Cli/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using ZeroInstall.Commands;
5 | using ZeroInstall.Commands.Basic;
6 |
7 | ProgramUtils.Init();
8 |
9 | using var handler = new CliCommandHandler();
10 | return (int)ProgramUtils.Run("0install", [Run.Name, ..args], handler);
11 |
--------------------------------------------------------------------------------
/src/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Alias.Cli/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using ZeroInstall.Commands;
5 | using ZeroInstall.Commands.Desktop;
6 |
7 | ProgramUtils.Init();
8 |
9 | using var handler = new CliCommandHandler();
10 | return (int)ProgramUtils.Run("0install", [AddAlias.Name, ..args], handler);
11 |
--------------------------------------------------------------------------------
/tests/export.ps1:
--------------------------------------------------------------------------------
1 | 0install export https://apps.0install.net/devel/cloc.xml $env:TEMP\0install-export
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
4 | & $env:TEMP\0install-export\import.cmd
5 | if ((0, 1) -NotContains $LASTEXITCODE) {throw "Exit Code: $LASTEXITCODE"} # Expect OK or NoChanges
6 |
7 | Remove-Item -Recurse $env:TEMP\0install-export
8 |
--------------------------------------------------------------------------------
/src/Store.Management.Cli/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using ZeroInstall.Commands;
5 | using ZeroInstall.Commands.Basic;
6 |
7 | ProgramUtils.Init();
8 |
9 | using var handler = new CliCommandHandler();
10 | return (int)ProgramUtils.Run("0install", [StoreMan.Name, ..args], handler);
11 |
--------------------------------------------------------------------------------
/src/Bootstrap/VERIFICATION.txt:
--------------------------------------------------------------------------------
1 | VERIFICATION
2 | Verification is intended to assist the Chocolatey moderators and community
3 | in verifying that this package's contents are trustworthy.
4 |
5 | This package is published by the Zero Install Project itself. The binary
6 | 0install.exe is identical to the file that can be downloaded from:
7 | https://get.0install.net/0install.exe
8 |
--------------------------------------------------------------------------------
/tests/store-dirs.ps1:
--------------------------------------------------------------------------------
1 | 0install store add-dir $env:TEMP\implementations
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
4 | $output = 0install store list --batch
5 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
6 | if ($output -NotContains "ReadWrite: $env:TEMP\implementations") { throw "Wrong output" }
7 |
8 | 0install store remove-dir $env:TEMP\implementations
9 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
10 |
--------------------------------------------------------------------------------
/tests/catalog.ps1:
--------------------------------------------------------------------------------
1 | 0install catalog refresh
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
4 | 0install catalog search vlc
5 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
6 |
7 | 0install catalog add https://apps.0install.net/0install/catalog.xml
8 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
9 |
10 | 0install catalog remove https://apps.0install.net/0install/catalog.xml
11 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
12 |
--------------------------------------------------------------------------------
/tests/trust.ps1:
--------------------------------------------------------------------------------
1 | 0install trust remove 88C8A1F375928691D7365C0259AA3927C24E4E1E apps.0install.net
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
4 | Write-Output "Error expected here:"
5 | 0install select --refresh --batch https://apps.0install.net/devel/terraform.xml
6 | if ($LASTEXITCODE -ne 27) {throw "Exit Code: $LASTEXITCODE"}
7 |
8 | 0install trust add 88C8A1F375928691D7365C0259AA3927C24E4E1E apps.0install.net
9 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
10 |
--------------------------------------------------------------------------------
/src/Bootstrap/ConfigExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using ZeroInstall.Store.Configuration;
5 |
6 | namespace ZeroInstall;
7 |
8 | public static class ConfigExtensions
9 | {
10 | ///
11 | /// Reads options bundled together with the .
12 | ///
13 | public static void ReadFromBootstrapConfig(this Config config)
14 | => config.ReadFrom(BootstrapConfig.Instance.IniData);
15 | }
16 |
--------------------------------------------------------------------------------
/GitVersion.yml:
--------------------------------------------------------------------------------
1 | mode: ContinuousDeployment
2 |
3 | # Generate 0install-compatible version numbers
4 | branches:
5 | # Mainline branches
6 | main:
7 | tag: rc-pre
8 | develop:
9 | tag: pre
10 | increment: patch
11 |
12 | # Stabilization branches
13 | release:
14 | tag: rc
15 | hotfix:
16 | tag: rc
17 |
18 | # Topic branches
19 | feature:
20 | tag: pre-pre
21 | pull-request:
22 | tag: pre-pre
23 | fallback:
24 | source-branches: [main]
25 | regex: ^(?!main|master|develop|release|hotfix|feature|pull|pr)
26 | tag: pre-pre
27 |
--------------------------------------------------------------------------------
/tests/config.ps1:
--------------------------------------------------------------------------------
1 | 0install config
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
4 | 0install config self_update_uri
5 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
6 |
7 | 0install config self_update_uri '""'
8 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
9 |
10 | Write-Output "Error expected here:"
11 | 0install self update
12 | if ($LASTEXITCODE -eq 0) { throw "Exit Code: $LASTEXITCODE" }
13 |
14 | 0install config self_update_uri default
15 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
16 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["config:base", ":disableDependencyDashboard"],
4 | "ignoreDeps": ["System.Resources.Extensions"],
5 | "packageRules": [
6 | {
7 | "matchPackagePatterns": ["^Generator\\.Equals"],
8 | "groupName": "Generator.Equals",
9 | "automerge": true,
10 | "automergeType": "branch"
11 | },
12 | {
13 | "matchPackagePatterns": ["wix", "ILRepack", "AeroWizard"],
14 | "automerge": true,
15 | "automergeType": "branch"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/tests/desktop-integration.au3:
--------------------------------------------------------------------------------
1 | Run("ZeroInstall")
2 |
3 | ;Search for VLC in catalog
4 | WinWaitActive("Zero Install")
5 | Send("{RIGHT}{TAB}VLC")
6 |
7 | ;Integrate VLC
8 | Send("{TAB}{TAB}{ENTER}{ENTER}")
9 | Opt("WinTitleMatchMode", 2)
10 | WinWaitActive("VLC media player")
11 | Send("{ENTER}")
12 |
13 | ;Ensure menu entry was created
14 | If Not FileExists(EnvGet("appdata") & "\Microsoft\Windows\Start Menu\Programs\AudioVideo\VLC media player.lnk") Then
15 | Exit(1)
16 | EndIf
17 |
18 | ;Remove VLC
19 | WinWaitActive("Zero Install")
20 | Send("{ENTER}{TAB}{ENTER}")
21 |
22 | WinClose("Zero Install")
23 |
--------------------------------------------------------------------------------
/tests/feed-dirs.ps1:
--------------------------------------------------------------------------------
1 | 0install add-feed https://apps.0install.net/0install/0install.xml https://apps.0install.net/0install/0install-win.xml
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
4 | $output = 0install list-feeds https://apps.0install.net/0install/0install.xml --batch
5 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
6 | if ($output -NotContains "https://apps.0install.net/0install/0install-win.xml") { throw "Wrong output" }
7 |
8 | 0install remove-feed https://apps.0install.net/0install/0install.xml https://apps.0install.net/0install/0install-win.xml
9 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
10 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using NanoByte.Common.Native;
5 | using ZeroInstall.Commands;
6 | using ZeroInstall.Commands.WinForms;
7 |
8 | ProgramUtils.Init();
9 | WindowsUtils.SetCurrentProcessAppID(ZeroInstallInstance.IsIntegrated ? "ZeroInstall" : "ZeroInstall.NotIntegrated");
10 | Application.EnableVisualStyles();
11 | Application.SetCompatibleTextRenderingDefault(false);
12 | ErrorReportForm.SetupMonitoring(new("https://0install.de/error-report/"));
13 |
14 | using var handler = new GuiCommandHandler();
15 | return (int)ProgramUtils.Run("0install-win", args, handler);
16 |
--------------------------------------------------------------------------------
/src/Bootstrap.WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | ProgramUtils.Init();
5 | Application.EnableVisualStyles();
6 | Application.SetCompatibleTextRenderingDefault(false);
7 |
8 | ErrorReportForm.SetupMonitoring(new("https://0install.de/error-report/"));
9 |
10 | using var handler = new GuiBootstrapHandler();
11 |
12 | try
13 | {
14 | return (int)ProgramUtils.Run(args, handler);
15 | }
16 | #region Error handling
17 | catch (Win32Exception ex) // Commonly caused by GDI object exhaustion
18 | {
19 | Msg.Inform(null, ex.Message, MsgSeverity.Error);
20 | return -1;
21 | }
22 | #endregion
23 |
--------------------------------------------------------------------------------
/src/Alias.Cli/Alias.Cli.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ZeroInstall.Alias.Cli
6 | 0alias
7 | A shortcut for '0install add-alias'.
8 | Exe
9 | ..\..\artifacts\$(Configuration)\
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Launcher.Cli/Launcher.Cli.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ZeroInstall.Launcher.Cli
6 | 0launch
7 | A shorcut for '0install run'.
8 | Exe
9 | ..\..\artifacts\$(Configuration)\
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Store.Service/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Code Analysis results, point to "Suppress Message", and click
8 | // "In Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2232:MarkWindowsFormsEntryPointsWithStaThread", Justification = "Does not show a GUI")]
12 |
--------------------------------------------------------------------------------
/src/ZeroInstall.Windows.slnx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Code Analysis results, point to "Suppress Message", and click
8 | // "In Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2232:MarkWindowsFormsEntryPointsWithStaThread", Justification = "GUI is created on a different thread")]
12 |
--------------------------------------------------------------------------------
/src/Bootstrap.WinForms/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Code Analysis results, point to "Suppress Message", and click
8 | // "In Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2232:MarkWindowsFormsEntryPointsWithStaThread", Justification = "GUI is created on a different thread")]
12 |
--------------------------------------------------------------------------------
/src/Alias.Cli/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click
8 | // "In Project Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Alias", Scope = "namespace", Target = "ZeroInstall.Alias.Cli")]
12 |
--------------------------------------------------------------------------------
/src/Bootstrap/CliBootstrapHandler.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | namespace ZeroInstall;
5 |
6 | ///
7 | /// Informs the user about the progress of tasks and ask questions during the bootstrap process using console output.
8 | ///
9 | /// This class is thread-safe.
10 | public class CliBootstrapHandler : CliTaskHandler, IBootstrapHandler
11 | {
12 | ///
13 | public bool IsGui => false;
14 |
15 | ///
16 | public bool Background { get => false; set {} }
17 |
18 | ///
19 | public string? GetCustomStorePath(bool machineWide, string? currentPath) => currentPath;
20 | }
21 |
--------------------------------------------------------------------------------
/0install.ps1:
--------------------------------------------------------------------------------
1 | $ErrorActionPreference = "Stop"
2 |
3 | function Download-ZeroInstall {
4 | $dir = "$env:LOCALAPPDATA\0install.net\bootstrapper"
5 | $file = "$dir\0install.exe"
6 | if (!(Test-Path $file)) {
7 | mkdir -Force $dir | Out-Null
8 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls11,Tls12'
9 | Invoke-WebRequest "https://get.0install.net/0install.exe" -OutFile $file
10 | }
11 | return $file
12 | }
13 |
14 | function Run-ZeroInstall {
15 | if (Get-Command 0install -ErrorAction SilentlyContinue) {
16 | 0install @args | %{ "$_" }
17 | } else {
18 | . $(Download-ZeroInstall) @args | %{ "$_" }
19 | }
20 | }
21 |
22 | Run-ZeroInstall @args
23 |
--------------------------------------------------------------------------------
/src/Store.Management.Cli/Store.Management.Cli.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ZeroInstall.Store.Management.Cli
6 | 0store
7 | Manages caches of Zero Install implementations via the command-line.
8 | Exe
9 | ..\..\artifacts\$(Configuration)\
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Bootstrap/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Store.Service/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using System.ServiceProcess;
5 | using NanoByte.Common.Native;
6 | using ZeroInstall.Store.Service;
7 |
8 | // Encode installation path into mutex name to allow instance detection during updates
9 | string mutexName = "mutex-" + Locations.InstallBase.GetHashCode();
10 | if (AppMutex.Probe(mutexName + "-update")) return 999;
11 |
12 | // NOTE: Do not block updater from starting because it will automatically stop service
13 |
14 | using var service = new StoreService();
15 | if (args.Contains("--debug"))
16 | {
17 | service.Start();
18 | Thread.Sleep(int.MaxValue);
19 | }
20 | else ServiceBase.Run([new StoreService()]);
21 |
22 | return 0;
23 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/FormUtils.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using NanoByte.Common.Native;
5 |
6 | namespace ZeroInstall.Commands.WinForms;
7 |
8 | ///
9 | /// Provides extension methods for s.
10 | ///
11 | internal static class FormExtensions
12 | {
13 | ///
14 | /// Prevents the window from being pinned to the taskbar if the current Zero Install instance is not integrated into the desktop environment.
15 | ///
16 | public static void PreventPinningIfNotIntegrated(this Form form)
17 | {
18 | if (!ZeroInstallInstance.IsIntegrated)
19 | form.HandleCreated += delegate { WindowsTaskbar.PreventPinning(form.Handle); };
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Bootstrap.WinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Store.Service/StoreServiceInstaller.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using System.Configuration.Install;
5 | using System.ServiceProcess;
6 |
7 | namespace ZeroInstall.Store.Service;
8 |
9 | ///
10 | /// Entry point used by InstallUtil.exe.
11 | ///
12 | [RunInstaller(true)]
13 | public class StoreServiceInstaller : Installer
14 | {
15 | public StoreServiceInstaller()
16 | {
17 | Installers.Add(new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem});
18 | Installers.Add(new ServiceInstaller
19 | {
20 | Description = "Manages a Zero Install implementation cache shared between all users.",
21 | DisplayName = "Zero Install Store Service",
22 | ServiceName = "0store-service",
23 | StartType = ServiceStartMode.Automatic
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Central.WinForms/AppTileStatus.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using ZeroInstall.DesktopIntegration;
5 |
6 | namespace ZeroInstall.Central.WinForms;
7 |
8 | ///
9 | /// Describes the status of an application represented by an .
10 | ///
11 | ///
12 | public enum AppTileStatus
13 | {
14 | /// The state has not been set yet.
15 | Unset,
16 |
17 | /// The application is listed in a but not in the .
18 | Candidate,
19 |
20 | /// The application is listed in the but is null.
21 | Added,
22 |
23 | /// The application is listed in the and is set.
24 | Integrated
25 | }
26 |
--------------------------------------------------------------------------------
/src/Store.Service/Store.Service.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ZeroInstall.Store.Service
6 | 0store-service
7 | Windows service for managing a Zero Install implementation cache shared between all users.
8 | WinExe
9 | ..\..\artifacts\$(Configuration)\
10 | app.manifest
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | branches:
2 | except: [translate]
3 |
4 | image: Visual Studio 2022
5 |
6 | environment:
7 | IGNORE_NORMALISATION_GIT_HEAD_MOVE: '1'
8 | DOTNET_NOLOGO: '1'
9 |
10 | cache:
11 | - '%USERPROFILE%\.nuget\packages -> **\*.csproj,**\*.targets,**\*.props'
12 |
13 | before_build:
14 | - gitversion /verbosity quiet /output buildserver
15 |
16 | build_script:
17 | - powershell .\src\build.ps1 %GitVersion_NuGetVersion%
18 |
19 | test_script:
20 | - powershell .\test.ps1 -Purge
21 | - powershell .\test.ps1 -Deploy -Purge
22 | - powershell .\test.ps1 -Deploy -Machine -Purge
23 | - powershell .\test.ps1 -Deploy -Portable -Purge
24 |
25 | artifacts:
26 | - path: artifacts
27 |
28 | deploy:
29 | - provider: Webhook
30 | url: https://app.signpath.io/API/v1/0e70cf92-49a1-4427-a800-b6bc5b497936/Integrations/AppVeyor?ProjectSlug=win&SigningPolicySlug=release-signing
31 | authorization:
32 | secure: 1lrrvByUN3qR7P/QQN6XXy4LWmh8ls/veOESoeVffvyF4kOqo28JxoZtIxYOZZpAZKlbAv8tWQaLFZiUxXFHmA==
33 | on:
34 | appveyor_repo_tag: true
35 |
--------------------------------------------------------------------------------
/src/Central.WinForms/Properties/AppResources.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | namespace ZeroInstall.Central.WinForms.Properties;
5 |
6 | ///
7 | /// Static preload of commonly used app-related resources.
8 | ///
9 | internal static class AppResources
10 | {
11 | public static readonly ScalableImage
12 | CandidateImage = new(ImageResources.AppCandidate),
13 | AddedImage = new(ImageResources.AppAdded),
14 | IntegratedImage = new (ImageResources.AppIntegrated);
15 |
16 | public static readonly string
17 | CandidateText = Resources.MyAppsAdd,
18 | AddedText = Resources.MyAppsAdded,
19 | IntegratedText = Resources.MyAppsAddedAndIntegrate;
20 |
21 | public static readonly string
22 | RunText = Resources.Run,
23 | RunWithOptionsText = Resources.RunWithOptions,
24 | UpdateText = Resources.Update,
25 | IntegrateText = Resources.Integrate,
26 | ModifyText = Resources.ModifyIntegration,
27 | RemoveText = Resources.Remove,
28 | Working = Resources.Working;
29 | }
30 |
--------------------------------------------------------------------------------
/tests/apps.ps1:
--------------------------------------------------------------------------------
1 | 0install add https://apps.0install.net/devel/terraform.xml --no-download
2 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
3 |
4 | $output = 0install list-apps terraform --batch
5 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
6 | if ($output -NotContains "https://apps.0install.net/devel/terraform.xml: HashiCorp Terraform []") { throw "Wrong output" }
7 |
8 | 0install list-apps --xml > "$env:TEMP\0install-applist.xml"
9 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
10 |
11 | 0install remove https://apps.0install.net/devel/terraform.xml
12 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
13 |
14 | 0install import-apps "$env:TEMP\0install-applist.xml" --no-download
15 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
16 |
17 | $output = 0install list-apps terraform --batch
18 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
19 | if ($output -NotContains "https://apps.0install.net/devel/terraform.xml: HashiCorp Terraform []") { throw "Wrong output" }
20 |
21 | 0install remove https://apps.0install.net/devel/terraform.xml
22 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
23 |
--------------------------------------------------------------------------------
/src/Store.Service/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | true
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/Central.WinForms/MinimalTaskHandler.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | namespace ZeroInstall.Central.WinForms;
5 |
6 | ///
7 | /// Like but with for .
8 | ///
9 | public class MinimalTaskHandler : GuiTaskHandlerBase
10 | {
11 | private readonly Control _owner;
12 |
13 | ///
14 | /// Creates a new minimal handler.
15 | ///
16 | /// The parent window owning the handler.
17 | public MinimalTaskHandler(Control owner)
18 | {
19 | _owner = owner;
20 | }
21 |
22 | ///
23 | protected override bool AskInteractive(string question, bool defaultAnswer)
24 | {
25 | bool result = false;
26 | Log.Debug("Question: " + question);
27 | _owner.Invoke(() => result = Msg.YesNo(_owner, question, MsgSeverity.Info));
28 | Log.Debug("Answer: " + result);
29 | return result;
30 | }
31 |
32 | ///
33 | /// Cancels currently running s.
34 | ///
35 | public void Cancel()
36 | => CancellationTokenSource.Cancel();
37 | }
38 |
--------------------------------------------------------------------------------
/tests/store.ps1:
--------------------------------------------------------------------------------
1 | $digest = 0install digest "$PSScriptRoot\..\artifacts\Release\net472\publish" --algorithm=sha256new --batch
2 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
3 |
4 | 0install store add $digest "$PSScriptRoot\..\artifacts\Release\net472\publish"
5 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
6 |
7 | 0install store find $digest
8 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
9 |
10 | 0install store verify $digest
11 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
12 |
13 | $output = 0install store list-implementations --batch
14 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
15 | if ($output.Where({ $_.Contains($digest) }, 'First').Count -eq 0) { throw "Wrong output" }
16 |
17 | 0install store export $digest "$env:TEMP\0install-export.tar.gz"
18 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
19 |
20 | 0install store remove $digest
21 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
22 |
23 | 0install store add $digest "$env:TEMP\0install-export.tar.gz"
24 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
25 |
26 | Remove-Item "$env:TEMP\0install-export.tar.gz"
27 |
28 | 0install store remove $digest
29 | if ($LASTEXITCODE -ne 0) { throw "Exit Code: $LASTEXITCODE" }
30 |
--------------------------------------------------------------------------------
/.github/workflows/translate-upload.yml:
--------------------------------------------------------------------------------
1 | name: Translate Upload
2 | on:
3 | workflow_dispatch: {}
4 | push:
5 | branches: [master]
6 | paths: ['**/*.resx', '!**/*.*.resx'] # non-localized resource files
7 |
8 | jobs:
9 | translate-upload:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v6
13 | with:
14 | fetch-depth: 0
15 | show-progress: false
16 |
17 | - name: Filter non-localizable WinForms resources
18 | shell: pwsh
19 | run: |
20 | foreach ($file in (Get-ChildItem src -Recurse -Filter "*Form.resx") + (Get-ChildItem src -Recurse -Filter "*Dialog.resx") + (Get-ChildItem src -Recurse -Filter "*Wizard.resx")) {
21 | [xml]$localized = Get-Content $file.FullName.Replace(".resx", ".de.resx")
22 | [xml]$source = Get-Content $file.FullName
23 | $source.root.assembly + $source.root.metadata + ($source.root.data | where { !$localized.root.data.name.Contains($_.name) }) | foreach { $source.root.RemoveChild($_) } | Out-Null
24 | $source.Save($file.FullName)
25 | git update-index --assume-unchanged $file.FullName
26 | }
27 |
28 | - name: Transifex Push
29 | run: ./0install.sh run https://apps.0install.net/devel/transifex-cli.xml --token ${{secrets.TRANSIFEX_API_KEY}} push --source
30 |
--------------------------------------------------------------------------------
/0install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | if [ "$#" -eq 0 ]; then
5 | echo "This script runs 0install from your PATH or downloads it on-demand."
6 | echo ""
7 | echo "To run 0install commands without adding 0install to your PATH:"
8 | echo "./0install.sh --help"
9 | echo "./0install.sh COMMAND [OPTIONS]"
10 | echo ""
11 | echo "To install to /usr/local:"
12 | echo "sudo ./0install.sh install local"
13 | echo ""
14 | echo "To install to your home directory:"
15 | echo "./0install.sh install home"
16 | exit 1
17 | fi
18 |
19 | download() {
20 | zeroinstall_release=0install-$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m)-${ZEROINSTALL_VERSION:-latest}
21 | download_dir=~/.cache/0install.net/$zeroinstall_release
22 |
23 | if [ ! -f $download_dir/files/0install ]; then
24 | echo "Downloading 0install..." >&2
25 | rm -rf $download_dir
26 | mkdir -p $download_dir
27 | curl -sSL https://get.0install.net/$zeroinstall_release.tar.bz2 | tar xj --strip-components 1 --directory $download_dir
28 | fi
29 | }
30 |
31 | if [ "$1" = "install" ]; then
32 | download
33 | shift 1
34 | $download_dir/install.sh "$@"
35 | else
36 | if command -v 0install > /dev/null 2> /dev/null; then
37 | 0install "$@"
38 | else
39 | download
40 | $download_dir/files/0install "$@"
41 | fi
42 | fi
43 |
--------------------------------------------------------------------------------
/src/Bootstrap/IBootstrapHandler.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | namespace ZeroInstall;
5 |
6 | ///
7 | /// Used to run and track s and ask the user questions during the bootstrap process.
8 | ///
9 | /// Implementations of this interface are thread-safe.
10 | public interface IBootstrapHandler : ITaskHandler
11 | {
12 | ///
13 | /// Indicates whether this handler is a GUI.
14 | ///
15 | bool IsGui { get; }
16 |
17 | ///
18 | /// Hides the GUI. Has no effect when is false.
19 | ///
20 | bool Background { get; set; }
21 |
22 | ///
23 | /// Asks the user to provide a custom path for storing implementations.
24 | ///
25 | /// Ask for a path for machine-wide deployment instead of just for the current user.
26 | /// The currently set custom path for storing implementations; null if using default location.
27 | /// The path to a directory; null or empty to use the default location.
28 | /// The user cancelled the operation.
29 | string? GetCustomStorePath(bool machineWide, string? currentPath);
30 | }
31 |
--------------------------------------------------------------------------------
/0install-win.xml.template:
--------------------------------------------------------------------------------
1 |
2 |
3 | Zero Install for Windows
4 | Windows version of 0install, the decentralized installation system
5 | This is the Windows version of Zero Install. Zero Install is a cross-platform, decentralized installation system. Instead of having a central repository in which all software is placed under a naming scheme managed by some central authority, programs and libraries in Zero Install are identified by URIs. Anyone who can create a web-page can publish software. Anyone can install software (not just administrators).
6 |
7 |
8 | https://0install.net/
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/tests/desktop-integration.ps1:
--------------------------------------------------------------------------------
1 | 0install add terraform https://apps.0install.net/devel/terraform.xml --no-download --batch
2 | if ($LASTEXITCODE -eq 50) {
3 | Write-Output "Skipping desktop integration tests in portable mode"
4 | return
5 | }
6 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
7 |
8 | $output = 0install list-apps terraform --batch
9 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
10 | if ($output -NotContains "https://apps.0install.net/devel/terraform.xml: HashiCorp Terraform [AppAlias: terraform]") { throw "Wrong output" }
11 |
12 | & "$env:appdata\0install.net\desktop-integration\aliases\terraform.exe" --help | Out-Null
13 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
14 |
15 | 0install-win integrate https://apps.0install.net/gui/vlc.xml --add-standard --no-download | Out-Null
16 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
17 | if (-Not(Test-Path "$env:appdata\Microsoft\Windows\Start Menu\Programs\AudioVideo\VLC media player.lnk")) {throw "Missing menu entry"}
18 |
19 | 0install repair-all
20 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
21 |
22 | 0install remove https://apps.0install.net/devel/terraform.xml
23 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
24 |
25 | 0install remove https://apps.0install.net/gui/vlc.xml
26 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
27 | Start-Sleep -Seconds 5 # May trigger implicit removal of "library mode" instance of Zero Install
28 |
--------------------------------------------------------------------------------
/test.ps1:
--------------------------------------------------------------------------------
1 | Param ([Switch]$Deploy, [Switch]$Machine, [Switch]$Portable, [Switch]$Purge)
2 | $ErrorActionPreference = "Stop"
3 |
4 | $previousPath = $env:PATH
5 | $env:PATH = "$PSScriptRoot\artifacts\Release\net472\publish;$env:PATH"
6 | if ($Deploy) {
7 | if ($Portable) {
8 | Write-Output "Deploying portable instance for integration tests"
9 | 0install self deploy --batch --portable "$env:TEMP\0install-portable"
10 | $env:PATH = "$env:TEMP\0install-portable;$env:PATH"
11 | } elseif ($Machine) {
12 | Write-Output "Deploying machine-wide instance for integration tests"
13 | 0install self deploy --batch --machine
14 | $env:PATH = "$env:appdata\Programs\Zero Install;$env:PATH"
15 | } else {
16 | Write-Output "Deploying per-user instance for integration tests"
17 | 0install self deploy --batch
18 | $env:PATH = "$env:ProgramFiles\Zero Install;$env:PATH"
19 | }
20 | } else {
21 | Write-Output "Using local build for integration tests"
22 | }
23 |
24 | foreach ($script in Get-ChildItem "$PSScriptRoot\tests" -Filter "*.ps1") {
25 | Write-Output $script.Name
26 | & $script.FullName
27 | }
28 |
29 | if ($Purge) {
30 | 0install store purge --batch
31 | if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
32 | }
33 |
34 | if ($Deploy) {
35 | if ($Portable) {
36 | Remove-Item -Recurse "$env:TEMP\0install-portable"
37 | } else {
38 | 0install self remove --batch
39 | Start-Sleep -Seconds 5
40 | }
41 | }
42 | $env:PATH = $previousPath
43 |
--------------------------------------------------------------------------------
/src/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | true
30 | true
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/CommandUtils.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using System.Diagnostics;
5 |
6 | namespace ZeroInstall.Commands.WinForms;
7 |
8 | ///
9 | /// Helpers for running 0install-win commands.
10 | ///
11 | public class CommandUtils
12 | {
13 | ///
14 | /// Starts a 0install-win command and does not wait for it to complete.
15 | ///
16 | /// Command name with arguments to execute.
17 | public static void Start(params string?[] args)
18 | {
19 | try
20 | {
21 | GetStartInfo(args).Start();
22 | }
23 | #region Error handling
24 | catch (IOException ex)
25 | {
26 | Msg.Inform(null, ex.Message, MsgSeverity.Error);
27 | }
28 | #endregion
29 | }
30 |
31 | ///
32 | /// Starts a 0install-win command elevated as Administrator and does not wait for it to complete.
33 | ///
34 | /// Command name with arguments to execute.
35 | public static void StartAsAdmin(params string?[] args)
36 | {
37 | try
38 | {
39 | GetStartInfo(args).AsAdmin().Start();
40 | }
41 | #region Error handling
42 | catch (OperationCanceledException) {}
43 | catch (IOException ex)
44 | {
45 | Msg.Inform(null, ex.Message, MsgSeverity.Error);
46 | }
47 | #endregion
48 | }
49 |
50 | private static ProcessStartInfo GetStartInfo(string?[] args)
51 | => ProcessUtils.Assembly("0install-win", args.WhereNotNull().ToArray());
52 | }
53 |
--------------------------------------------------------------------------------
/src/Store.Service/StoreService.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ZeroInstall.Store.Service
2 | {
3 | partial class StoreService
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.eventLog = new System.Diagnostics.EventLog();
32 | ((System.ComponentModel.ISupportInitialize)(this.eventLog)).BeginInit();
33 | //
34 | // eventLog
35 | //
36 | this.eventLog.Log = "Application";
37 | this.eventLog.Source = "Zero Install Store Service";
38 | //
39 | // Service
40 | //
41 | this.ServiceName = "Zero Install Store Service";
42 | ((System.ComponentModel.ISupportInitialize)(this.eventLog)).EndInit();
43 |
44 | }
45 |
46 | #endregion
47 |
48 | private System.Diagnostics.EventLog eventLog;
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Commands.WinForms/GuiCommandHandler.Form.cs:
--------------------------------------------------------------------------------
1 | // Copyright Bastian Eicher et al.
2 | // Licensed under the GNU Lesser Public License
3 |
4 | using NanoByte.Common.Threading;
5 |
6 | namespace ZeroInstall.Commands.WinForms;
7 |
8 | partial class GuiCommandHandler
9 | {
10 | private readonly Lazy _branding;
11 |
12 | private FeedBranding Branding => _branding.Value;
13 |
14 | private readonly AsyncFormWrapper _form;
15 |
16 | private void ShowForm(Action action) => _form.Post(form =>
17 | {
18 | ShowOnce(form);
19 | action(form);
20 | });
21 |
22 | private T ShowForm(Func action) => _form.Post(form =>
23 | {
24 | ShowOnce(form);
25 | return action(form);
26 | });
27 |
28 | private bool _shown;
29 |
30 | private void ShowOnce(ProgressForm form)
31 | {
32 | if (_shown) return;
33 | _shown = true;
34 |
35 | if (Background) form.ShowTrayIcon();
36 | else form.Show();
37 | }
38 |
39 | private DialogResult SwitchToDialog(Func