(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"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>openlivewriter.install</id>
|
||||
<version>0.0.0.0</version>
|
||||
<title>Open Live Writer</title>
|
||||
<authors>Open Live Writer</authors>
|
||||
<licenseUrl>https://github.com/OpenLiveWriter/OpenLiveWriter/blob/master/license.txt?raw=true</licenseUrl>
|
||||
<iconUrl>http://openlivewriter.github.io/favicon.ico</iconUrl>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<description>Open Live Writer makes it easy to write, preview and post to your blog.</description>
|
||||
<summary>Open Live Writer</summary>
|
||||
<tags>Blog WindowsLiveWriter Open Live Writer</tags>
|
||||
<releaseNotes>https://github.com/OpenLiveWriter/OpenLiveWriter/releases</releaseNotes>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="Setup.exe" target="tools" />
|
||||
<file src="..\choco\chocolateyInstall.ps1" target="tools"/>
|
||||
</files>
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>openlivewriter</id>
|
||||
<version>0.5.0.0</version>
|
||||
<title>OpenLiveWriter (Install)</title>
|
||||
<authors>See list of authors at http://openlivewriter.org/</authors>
|
||||
<owners>Darwin Sanoy, OpenLiveWriter</owners>
|
||||
<licenseUrl>https://github.com/OpenLiveWriter/OpenLiveWriter/blob/master/license.txt</licenseUrl>
|
||||
<projectUrl>http://openlivewriter.org/</projectUrl>
|
||||
<iconUrl>https://cdn.rawgit.com/csi-windowschocolatey/openlivewriter/master/app.png</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Open Live Writer is an open source application enabling users to author, edit, and publish blog posts.
|
||||
It is based on a fork of the well-loved but not actively developed Windows Live Writer code.</description>
|
||||
<summary>Open Live Writer makes it easy to write, preview, and post to your blog.</summary>
|
||||
<copyright>.NET Foundation</copyright>
|
||||
<tags>Blog WindowsLiveWriter OpenLiveWriter</tags>
|
||||
<releaseNotes>https://github.com/OpenLiveWriter/OpenLiveWriter/releases</releaseNotes>
|
||||
<!--<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>
|
|
@ -1,7 +1,9 @@
|
|||
$packageName = 'openLiveWriter.install'
|
||||
$fileType = 'exe'
|
||||
$packageName= 'openlivewriter'
|
||||
$fileType = 'EXE'
|
||||
$silentArgs = '--silent'
|
||||
$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