From 1123b015f98c64ed41920fb61d19e99cfa8e9d89 Mon Sep 17 00:00:00 2001 From: Philipp Feigl Date: Tue, 24 Apr 2018 21:41:26 +0200 Subject: [PATCH 1/4] Strong passwords (anything except [a-zA-Z0-9_]) are now being obfuscated correctly for signtool calls --- src/Update/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Update/Program.cs b/src/Update/Program.cs index 24c56407..b48c64a9 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -641,7 +641,7 @@ namespace Squirrel.Update String.Format("sign {0} \"{1}\"", signingOpts, exePath), CancellationToken.None); if (processResult.Item1 != 0) { - var optsWithPasswordHidden = new Regex(@"/p\s+\w+").Replace(signingOpts, "/p ********"); + var optsWithPasswordHidden = new Regex(@"/p\s+\S+").Replace(signingOpts, "/p ********"); var msg = String.Format("Failed to sign, command invoked was: '{0} sign {1} {2}'", exe, optsWithPasswordHidden, exePath); From afe47c9c064bf9860404c61d6ef36d8ecb250b04 Mon Sep 17 00:00:00 2001 From: Rufus Linke Date: Thu, 22 Nov 2018 10:42:12 +0100 Subject: [PATCH 2/4] fix bsdiff creation for patches that don't contain bsdiff extra data --- src/Squirrel/BinaryPatchUtility.cs | 16 +++++++++++----- test/DeltaPackageTests.cs | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/Squirrel/BinaryPatchUtility.cs b/src/Squirrel/BinaryPatchUtility.cs index b1eda7ec..1732ff8d 100644 --- a/src/Squirrel/BinaryPatchUtility.cs +++ b/src/Squirrel/BinaryPatchUtility.cs @@ -240,11 +240,14 @@ namespace Squirrel.Bsdiff long diffEndPosition = output.Position; WriteInt64(diffEndPosition - controlEndPosition, header, 16); - // write compressed extra data - using (WrappingStream wrappingStream = new WrappingStream(output, Ownership.None)) - using (var bz2Stream = new BZip2Stream(wrappingStream, CompressionMode.Compress)) + // write compressed extra data, if any + if (eblen > 0) { - bz2Stream.Write(eb, 0, eblen); + using (WrappingStream wrappingStream = new WrappingStream(output, Ownership.None)) + using (var bz2Stream = new BZip2Stream(wrappingStream, CompressionMode.Compress)) + { + bz2Stream.Write(eb, 0, eblen); + } } // seek to the beginning, write the header, then seek back to end @@ -326,10 +329,13 @@ namespace Squirrel.Bsdiff compressedDiffStream.Seek(c_headerSize + controlLength, SeekOrigin.Current); compressedExtraStream.Seek(c_headerSize + controlLength + diffLength, SeekOrigin.Current); + // the stream might end here if there is no extra data + var hasExtraData = compressedExtraStream.Position < compressedExtraStream.Length; + // decompress each part (to read it) using (var controlStream = new BZip2Stream(compressedControlStream, CompressionMode.Decompress)) using (var diffStream = new BZip2Stream(compressedDiffStream, CompressionMode.Decompress)) - using (var extraStream = new BZip2Stream(compressedExtraStream, CompressionMode.Decompress)) + using (var extraStream = hasExtraData ? new BZip2Stream(compressedExtraStream, CompressionMode.Decompress) : null) { long[] control = new long[3]; byte[] buffer = new byte[8]; diff --git a/test/DeltaPackageTests.cs b/test/DeltaPackageTests.cs index c14eb5d9..62c0ca01 100644 --- a/test/DeltaPackageTests.cs +++ b/test/DeltaPackageTests.cs @@ -290,5 +290,28 @@ namespace Squirrel.Tests.Core tempFiles.ForEach(File.Delete); } } + + [Fact] + public void HandleBsDiffWithoutExtraData() + { + var baseFileData = new byte[] { 1, 1, 1, 1 }; + var newFileData = new byte[] { 2, 1, 1, 1 }; + + byte[] patchData; + + using (var patchOut = new MemoryStream()) + { + Bsdiff.BinaryPatchUtility.Create(baseFileData, newFileData, patchOut); + patchData = patchOut.ToArray(); + } + + using (var toPatch = new MemoryStream(baseFileData)) + using (var patched = new MemoryStream()) + { + Bsdiff.BinaryPatchUtility.Apply(toPatch, () => new MemoryStream(patchData), patched); + + Assert.Equal(newFileData, patched.ToArray()); + } + } } } From fdaff4572f025c869b4a1f3e3c5020d120075ff2 Mon Sep 17 00:00:00 2001 From: Vegard Andreas Larsen Date: Fri, 25 Jan 2019 15:32:39 +0100 Subject: [PATCH 3/4] Add more information about machine-wide installs This information was found in issue #555. The information was kind of hard to find, so I summarized it here. --- docs/using/machine-wide-installs.md | 58 +++++++++++++++++------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/using/machine-wide-installs.md b/docs/using/machine-wide-installs.md index a5fb21f1..e1e43f8d 100644 --- a/docs/using/machine-wide-installs.md +++ b/docs/using/machine-wide-installs.md @@ -1,24 +1,36 @@ -| [docs](..) / [using](.) / machine-wide-installs.md -|:---| - - +| [docs](..) / [using](.) / machine-wide-installs.md +|:---| + + # Machine-wide Installs - -Squirrel's Releasify command generates an MSI file suitable for installation via Group Policy. This MSI isn't a general-purpose installer, this means that once you run the MSI, users from now on will get the app installed, on next Login. - -So, most normal users should continue to run the Setup.exe's generated by Releasify, but if you want to have an IT Admin Friendly version, you can hand off the MSI - -Most users of Squirrel won't have to do anything new to enable this behavior, though certain NuGet package IDs / names might cause problems with MSI. - -**Source:** See [issue #466](https://github.com/Squirrel/Squirrel.Windows/issues/466) for more details. - -### Disabling MSI Generation -Generating MSIs can be disabled via the --no-msi flag as shown below: - -~~~powershell -PM> Squirrel --releasify MyApp.1.0.0.nupkg --no-msi -~~~ - ---- -| Return: [Table of Contents](../readme.md) | -|----| + +Squirrel's Releasify command generates an MSI file suitable for installation via Group Policy. This MSI isn't a general-purpose installer, this means that once you run the MSI, users from now on will get the app installed, on next Login. + +So, most normal users should continue to run the Setup.exe's generated by Releasify, but if you want to have an IT Admin Friendly version, you can hand off the MSI + +## Common pitfalls + +### Missing data in `.nuspec` + +Most users of Squirrel won't have to do anything new to enable this behavior, though certain NuGet package IDs / names might cause problems with MSI. + +**Source:** See [issue #466](https://github.com/Squirrel/Squirrel.Windows/issues/466) for more details. + +### Nothing happens on login + +In cases where the end user has previously installed your application, the installer that runs on login will not re-install your application on every login. This can easily be the case if you as a developer is testing out both the EXE and the MSI. + +Squirrel leaves behind an almost-empty `%LocalAppData%\MyApp` folder after an uninstall. Deleting this folder (the entire folder, not just the contents) will allow the installer that runs on login to install successfully. + +**Source:**: See [issue #555](https://github.com/Squirrel/Squirrel.Windows/issues/555#issuecomment-253265130) for details. + +## Disabling MSI Generation +Generating MSIs can be disabled via the --no-msi flag as shown below: + +~~~powershell +PM> Squirrel --releasify MyApp.1.0.0.nupkg --no-msi +~~~ + +--- +| Return: [Table of Contents](../readme.md) | +|----| From 1eb2c20f051ce717d6a2b24ef3e068e08b0ce660 Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Fri, 27 Mar 2020 15:00:35 +0100 Subject: [PATCH 4/4] Remove outdated reference to ICSharpCode --- docs/getting-started/2-packaging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/2-packaging.md b/docs/getting-started/2-packaging.md index 7f24d12b..bd4f4f43 100644 --- a/docs/getting-started/2-packaging.md +++ b/docs/getting-started/2-packaging.md @@ -34,7 +34,7 @@ Section [NuGet Package Metadata](../using/nuget-package-metadata.md) provides ad 3. **Add lib & net45** - add the `lib` folder and the `net45` folder to the project. Squirrel is expecting a single `lib / net45` directory provided regardless of whether your app is a `net45` application. 4. **Add Release Files** - add all the files from `bin\Release` needed by MyApp to execute (including the various files required by Squirrel). * **Include MyApp Files:** MyApp.exe, MyApp.exe.config, any non-standard .NET dll's needed by MyApp.exe. - * **Include Squirrel Files:** Squirrel.dll, Splat.dll, NuGet.Squirrel.dll, Mono.Cecil.\*, DeltaCompressionDotNet.\*, ICSharpCode.SharpZipLib.\* + * **Include Squirrel Files:** Squirrel.dll, Splat.dll, NuGet.Squirrel.dll, Mono.Cecil.\*, DeltaCompressionDotNet.\*, * **Exclude:** *.vshost.\*, *.pdb files 5. **Save the NuGet Package File** - save the NuGet package file to where you can easily access later (e.g., `MyApp.sln` directory). Follow the given naming format (e.g., `MyApp.1.0.0.nupkg`).