Permalink
Browse files

Added clickonce publish

  • Loading branch information...
JakeGinnivan committed Apr 8, 2013
1 parent 904c53d commit 4f575fd5868860ee94396990296712933c2c06ff
Showing with 164 additions and 10 deletions.
  1. +1 −0 .gitignore
  2. +103 −0 Markpad.msbuild
  3. +1 −0 src/MarkPad.ncrunchsolution
  4. +6 −0 src/MarkPad.sln
  5. +15 −10 src/MarkPad/MarkPad.csproj
  6. +18 −0 tools/UpdateApplicationManifest.ps1
  7. +20 −0 tools/UpdateManifest.ps1
View
@@ -105,6 +105,7 @@ packages
# our output folder for build artifacts
artifacts/*.nupkg
+artifacts/ClickOnce/
src/GlobalAssemblyInfo.cs
Thumbs.db
View
@@ -0,0 +1,103 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration>Debug</Configuration>
+ <Root>$(MSBuildProjectDirectory)\</Root>
+ <Version Condition="$(BUILD_NUMBER)!=''">$(BUILD_NUMBER)</Version>
+ <Version Condition="$(Version)==''">0.0.0.0</Version>
+ </PropertyGroup>
+
+ <Target Name="Clean">
+ <ItemGroup>
+ <ProjectFiles Include="..\**\*.*proj" />
+ <OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)bin')" />
+ <OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)bin')" />
+ <OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)obj')" />
+ </ItemGroup>
+
+ <Delete Files="@(OldArtifacts)" ContinueOnError="true" />
+ <RemoveDir Directories="..\artifacts" ContinueOnError="true" />
+ <RemoveDir Directories="@(OldDirectories)" ContinueOnError="true" />
+ </Target>
+
+ <Target Name="Build" DependsOnTargets="Clean">
+ <MSBuild Projects="$(Root)src\MarkPad.sln" Targets="Rebuild" Properties="Configuration=$(Configuration);Platform=x86" />
+ </Target>
+
+ <Target Name="Publish" DependsOnTargets="Build">
+ <PropertyGroup>
+ <ClickOnceFolder>$(Root)artifacts\ClickOnce\</ClickOnceFolder>
+ <ClickOnceFiles>$(ClickOnceFolder)$(Version)\</ClickOnceFiles>
+ </PropertyGroup>
+ <ItemGroup>
+ <XmlFiles Include="$(Root)src\Markpad\bin\$(Configuration)\*.xml" />
+ <ClickOnceFilesToDelete Include="$(ClickOnceFolder)\**\*.*" />
+ </ItemGroup>
+
+ <Delete Files="@(ClickOnceFilesToDelete)" />
+ <RemoveDir Directories="@(ClickOnceFolder)" />
+
+ <ItemGroup>
+ <SourceFiles Include="$(Root)src\Markpad\bin\$(Configuration)\**\*.*" />
+ <!--Exclude="
+ $(Root)src\Markpad\bin\$(Configuration)\*.xml;
+ $(Root)src\Markpad\bin\$(Configuration)\en-US.dll;
+ $(Root)src\Markpad\bin\$(Configuration)\AwesomiumProcess;
+ $(Root)src\Markpad\bin\$(Configuration)\Awesomium.dll;
+ $(Root)src\Markpad\bin\$(Configuration)\icudt42.dll"-->
+ </ItemGroup>
+ <Copy SourceFiles="@(SourceFiles)" DestinationFolder="$(ClickOnceFiles)%(SourceFiles.RecursiveDir)"/>
+
+ <Exec Command="mage -New Application -ToFile $(ClickOnceFiles)Markpad.exe.manifest -Processor x86 -name &quot;Markpad&quot; -Version $(VERSION) -FromDirectory $(ClickOnceFiles) -IconFile markpad.ico" />
+ <Exec Command="powershell.exe -ExecutionPolicy RemoteSigned -NoProfile $(Root)tools\UpdateManifest.ps1 -ManifestFile $(ClickOnceFiles)Markpad.exe.manifest" />
+
+ <Exec Command="mage -New Deployment -ToFile $(ClickOnceFolder)Markpad.application -Processor x86 -Install true -Version $(Version) -Publisher &quot;Code52&quot; -AppManifest $(ClickOnceFiles)Markpad.exe.manifest" />
+
+ <Exec Command="powershell.exe -ExecutionPolicy RemoteSigned -NoProfile $(Root)tools\UpdateApplicationManifest.ps1 -ManifestFile $(ClickOnceFolder)Markpad.Application" />
+
+ <ItemGroup>
+ <DeploymentFiles Include="$(ClickOnceFiles)**\*.*" Exclude="$(ClickOnceFiles)Markpad.exe.manifest" />
+ </ItemGroup>
+
+ <Move SourceFiles="@(DeploymentFiles)" DestinationFiles="@(DeploymentFiles->'%(RootDir)%(Directory)%(FileName)%(Extension).deploy')" />
+ <!--<Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\Awesomium.Windows.Controls.XML"
+ DestinationFiles="$(ClickOnceFiles)\Awesomium.Windows.Controls.XML.deploy" />
+ <Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\Awesomium.Core.XML"
+ DestinationFiles="$(ClickOnceFiles)\Awesomium.Core.XML.deploy" />
+ <Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\en-US.dll"
+ DestinationFiles="$(ClickOnceFiles)\en-US.dll.deploy" />
+ <Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\AwesomiumProcess"
+ DestinationFiles="$(ClickOnceFiles)\AwesomiumProcess.deploy" />
+ <Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\Awesomium.dll"
+ DestinationFiles="$(ClickOnceFiles)\Awesomium.dll.deploy" />
+ <Copy SourceFiles="$(Root)src\Markpad\bin\$(Configuration)\icudt42.dll"
+ DestinationFiles="$(ClickOnceFiles)\icudt42.dll.deploy" />-->
+
+ <!--<MSBuild Projects="$(Root)src\MarkPad\Markpad.csproj" Targets="Publish" Properties="Configuration=$(Configuration);Platform=x86;SolutionDir=$(Root)src\" />-->
+ <!--<ItemGroup>
+ <ClickOnceFiles Include="$(Root)src\MarkPad\bin\$(Configuration)\app.publish\**\*.*"/>
+ </ItemGroup>
+
+ <Copy SourceFiles="@(ClickOnceFiles)" DestinationFolder="$(Root)Artifacts\ClickOnce\%(ClickOnceFiles.RecursiveDir)"/>-->
+ </Target>
+
+ <Target Name="Chocolatey" DependsOnTargets="Build">
+ <PropertyGroup>
+ <AssemblyConfig Condition=" '$(AssemblyConfig)' != '' ">-$(AssemblyConfig)</AssemblyConfig>
+ <BuildNumber Condition=" '$(BuildNumber)' == '0' "></BuildNumber>
+ <BuildNumber Condition=" '$(AssemblyConfig)' == '' And $(BuildNumber) != '' ">.$(BuildNumber)</BuildNumber>
+
+ <NuGet>..\src\.nuget\NuGet.exe</NuGet>
+ <OutputDirectory>-OutputDirectory "..\artifacts"</OutputDirectory>
+ <VersionArg>-Version $(CurrentVersion)$(AssemblyConfig)$(BuildNumber)</VersionArg>
+ <ConfigArg>-Prop Configuration=$(Configuration)</ConfigArg>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <NuSpec Include="$(Root)artifacts\*.nuspec" />
+ </ItemGroup>
+
+ <Exec Command='$(NuGet) pack "%(NuSpec.Identity)" $(OutputDirectory) $(VersionArg) $(ConfigArg)' />
+ </Target>
+
+</Project>
+
@@ -2,6 +2,7 @@
<FileVersion>1</FileVersion>
<AutoEnableOnStartup>False</AutoEnableOnStartup>
<AllowParallelTestExecution>false</AllowParallelTestExecution>
+ <AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
<FrameworkUtilisationTypeForGallio>UseStaticAnalysis</FrameworkUtilisationTypeForGallio>
<FrameworkUtilisationTypeForMSpec>UseStaticAnalysis</FrameworkUtilisationTypeForMSpec>
View
@@ -26,6 +26,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{2897F1
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DE6E50F7-097C-494B-8268-1D39A466116C}"
+ ProjectSection(SolutionItems) = preProject
+ ..\Markpad.msbuild = ..\Markpad.msbuild
+ ..\README.md = ..\README.md
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
View
@@ -1,38 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{393EB1F9-F80F-4B78-BEB3-11DD6714DA53}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MarkPad</RootNamespace>
<AssemblyName>MarkPad</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
+ <TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
- <Utf8Output>true</Utf8Output>
- <ExpressionBlendVersion>4.0.30816.0</ExpressionBlendVersion>
- <PublishUrl>publish\</PublishUrl>
+ <IsWebBootstrapper Condition="$(IsWebBootstrapper) == '' Or $(IsWebBootstrapper) == '*Undefined*'">false</IsWebBootstrapper>
+ <PublishUrl Condition="$(PublishUrl) == '' Or $(PublishUrl) == '*Undefined*'">publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
+ <UpdateEnabled Condition="$(UpdateEnabled) == '' Or $(UpdateEnabled) == '*Undefined*'">false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
+ <SupportUrl>https://github.com/Code52/DownmarkerWPF</SupportUrl>
+ <ProductName>Markpad</ProductName>
+ <PublisherName>Code52</PublisherName>
+ <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
+ <WebPage>Install.html</WebPage>
<ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
+ <ApplicationVersion Condition="$(ApplicationVersion) == '' Or $(ApplicationVersion) == '*Undefined*'">1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -78,6 +79,10 @@
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
+ <PropertyGroup />
+ <PropertyGroup>
+ <NoWin32Manifest>true</NoWin32Manifest>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=2.6.3.862, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -0,0 +1,18 @@
+Param($ManifestFile)
+write-host "Fixing up Manifest File"
+write-host $ManifestFile
+
+[xml]$xml = get-content $ManifestFile
+
+$xml.assembly.deployment.SetAttribute("trustURLParameters", "true")
+$xml.assembly.deployment.SetAttribute("mapFileExtensions", "true")
+
+$xml.assembly.deployment.subscription.update.RemoveAll()
+$updateNode = $xml.CreateElement("beforeApplicationStartup", "urn:schemas-microsoft-com:asm.v2")
+$xml.assembly.deployment.subscription.Item("update").AppendChild($updateNode)
+
+$updateNode = $xml.CreateElement("beforeApplicationStartup", "urn:schemas-microsoft-com:asm.v2")
+
+$xml.Save($ManifestFile)
+
+write-host "Fixed Manfiest File"
View
@@ -0,0 +1,20 @@
+Param($ManifestFile)
+write-host "Fixing up Manifest File"
+write-host $ManifestFile
+
+[xml]$xml = get-content $ManifestFile
+
+$elementsToRewrite = $xml.assembly.dependency | where {$_.dependentAssembly.codebase -ne $null -and ($_.dependentAssembly.codebase.Contains("Awesomium") -or $_.dependentAssembly.codebase.Contains("NHunspell")) }
+foreach ($elementToRewrite in $elementsToRewrite)
+{
+ $fileNode = $xml.CreateElement("file", "urn:schemas-microsoft-com:asm.v2")
+ $fileNode.SetAttribute("name", $elementToRewrite.dependentAssembly.codebase)
+ $fileNode.SetAttribute("size", $elementToRewrite.dependentAssembly.size)
+ $fileNode.AppendChild($elementToRewrite.dependentAssembly.hash)
+ $xml.assembly.AppendChild($fileNode)
+ [Void]$xml.assembly.RemoveChild($elementToRewrite)
+}
+
+$xml.Save($ManifestFile)
+
+write-host "Fixed Manfiest File"

0 comments on commit 4f575fd

Please sign in to comment.