(GH-57) Updating to reflect chocolatey.org package which has been pushed already
https://chocolatey.org/packages/openlivewriter
This commit is contained in:
parent
8d331c14ed
commit
b84fb56df8
|
@ -1,20 +1,26 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0"?>
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>openlivewriter.install</id>
|
<id>openlivewriter</id>
|
||||||
<version>0.0.0.0</version>
|
<version>0.5.0.0</version>
|
||||||
<title>Open Live Writer</title>
|
<title>OpenLiveWriter (Install)</title>
|
||||||
<authors>Open Live Writer</authors>
|
<authors>See list of authors at http://openlivewriter.org/</authors>
|
||||||
<licenseUrl>https://github.com/OpenLiveWriter/OpenLiveWriter/blob/master/license.txt?raw=true</licenseUrl>
|
<owners>Darwin Sanoy, OpenLiveWriter</owners>
|
||||||
<iconUrl>http://openlivewriter.github.io/favicon.ico</iconUrl>
|
<licenseUrl>https://github.com/OpenLiveWriter/OpenLiveWriter/blob/master/license.txt</licenseUrl>
|
||||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
<projectUrl>http://openlivewriter.org/</projectUrl>
|
||||||
<description>Open Live Writer makes it easy to write, preview and post to your blog.</description>
|
<iconUrl>https://cdn.rawgit.com/csi-windowschocolatey/openlivewriter/master/app.png</iconUrl>
|
||||||
<summary>Open Live Writer</summary>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<tags>Blog WindowsLiveWriter Open Live Writer</tags>
|
<description>Open Live Writer is an open source application enabling users to author, edit, and publish blog posts.
|
||||||
<releaseNotes>https://github.com/OpenLiveWriter/OpenLiveWriter/releases</releaseNotes>
|
It is based on a fork of the well-loved but not actively developed Windows Live Writer code.</description>
|
||||||
</metadata>
|
<summary>Open Live Writer makes it easy to write, preview, and post to your blog.</summary>
|
||||||
<files>
|
<copyright>.NET Foundation</copyright>
|
||||||
<file src="Setup.exe" target="tools" />
|
<tags>Blog WindowsLiveWriter OpenLiveWriter</tags>
|
||||||
<file src="..\choco\chocolateyInstall.ps1" target="tools"/>
|
<releaseNotes>https://github.com/OpenLiveWriter/OpenLiveWriter/releases</releaseNotes>
|
||||||
</files>
|
<!--<projectSourceUrl>https://github.com/OpenLiveWriter</projectSourceUrl>-->
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="OpenLiveWriterSetup.exe" target="tools" />
|
||||||
|
<file src="..\choco\chocolateyInstall.ps1" target="tools"/>
|
||||||
|
<file src="..\choco\chocolateyUninstall.ps1" target="tools"/>
|
||||||
|
</files>
|
||||||
</package>
|
</package>
|
|
@ -1,7 +1,9 @@
|
||||||
$packageName = 'openLiveWriter.install'
|
$packageName= 'openlivewriter'
|
||||||
$fileType = 'exe'
|
$fileType = 'EXE'
|
||||||
$silentArgs = '--silent'
|
$silentArgs = '--silent'
|
||||||
$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path)
|
$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path)
|
||||||
$fileFullPath = Join-Path $scriptPath 'Setup.exe'
|
$fileFullPath = Join-Path $scriptPath 'OpenLiveWriterSetup.exe'
|
||||||
|
|
||||||
Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $fileFullPath
|
Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $fileFullPath
|
||||||
|
|
||||||
|
Write-Output "The install log is at `"$env:localappdata\SquirrelTemp\SquirrelSetup.log`""
|
|
@ -0,0 +1,56 @@
|
||||||
|
$ErrorActionPreference = 'Stop';
|
||||||
|
|
||||||
|
$packageName = 'openlivewriter'
|
||||||
|
$softwareName = 'open live writer*'
|
||||||
|
$installerType = 'EXE'
|
||||||
|
$file = "$env:localappdata\OpenLiveWriter\Update.exe"
|
||||||
|
|
||||||
|
$silentArgs = '--uninstall -s'
|
||||||
|
|
||||||
|
if ($installerType -ne 'MSI') {
|
||||||
|
$validExitCodes = @(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
$uninstalled = $false
|
||||||
|
$local_key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
|
||||||
|
$machine_key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
|
||||||
|
$machine_key6432 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
|
||||||
|
|
||||||
|
$key = Get-ItemProperty -Path @($machine_key6432,$machine_key, $local_key) `
|
||||||
|
-ErrorAction SilentlyContinue `
|
||||||
|
| ? { $_.DisplayName -like "$softwareName" }
|
||||||
|
|
||||||
|
if (!(Test-Path "$env:localappdata\openlivewriter\openlivewriter.exe"))
|
||||||
|
{
|
||||||
|
If (!(Test-Path $file))
|
||||||
|
{
|
||||||
|
throw "Could not find $file - because this software is always installed to a user profile folder, it must be uninstalled in the context of the user who installed it."
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Try {
|
||||||
|
Uninstall-ChocolateyPackage -PackageName $packageName `
|
||||||
|
-FileType $installerType `
|
||||||
|
-SilentArgs "$silentArgs" `
|
||||||
|
-ValidExitCodes $validExitCodes `
|
||||||
|
-File "$file"
|
||||||
|
|
||||||
|
#Remove leftovers so new install will succeed
|
||||||
|
If (test-path "$env:localappdata\openlivewriter\.dead")
|
||||||
|
{
|
||||||
|
remove-item "$env:localappdata\openlivewriter" -Recurse -Force -ErrorAction 'SilentlyContinue'
|
||||||
|
}
|
||||||
|
If (test-path "C:\ProgramData\SquirrelMachineInstalls\OpenLiveWriter.exe")
|
||||||
|
{
|
||||||
|
remove-item "C:\ProgramData\SquirrelMachineInstalls\OpenLiveWriter.exe" -Force -ErrorAction 'SilentlyContinue'
|
||||||
|
}
|
||||||
|
Write-Output "The install log is at `"$env:localappdata\SquirrelTemp\SquirrelSetup.log`""
|
||||||
|
}
|
||||||
|
Catch
|
||||||
|
{
|
||||||
|
throw $_.Exception
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Warning "$packageName has already been uninstalled by other means or it is installed to a user's profile who is not the current user ($env:username)."
|
||||||
|
}
|
Loading…
Reference in New Issue