Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Installer Refactor #1

Merged
merged 4 commits into from

2 participants

@timheuer

I decided to contribute the refactoring of the installer. The powershell and reg files were giving me a rash knowing that the VSIX format could be used. I sprinkled some ferry dust on this and refactored to a build.cmd script that would spit out a VSIX file that one could double-click and it would install to VS without issue. Using this methods registers it as an extension so that you can easily uninstall it via VS extension manager.

@timheuer timheuer closed this
@timheuer timheuer reopened this
@timheuer

Fixed the issues and enabled VWDExpress as a SKU that this works within

@Haacked Haacked merged commit 2c59494 into Haacked:master
@Haacked
Owner

Thanks a huge amount! I tried to upload the VSIX to the Visual Studio Extension Gallery and it gave me this message.

You can only upload template VSIX files for the Visual Studio Express SKUs.

Any ideas?

@timheuer

bastards. my guess is because it has the PKGDEF in it...i'll verify.

@Haacked
Owner

Tim, can you also look into issue #2? Does that happen to you?

@timheuer
@Haacked
Owner

@timheuer I still can't upload the VSIX. :(

@timheuer
@Haacked
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
40 Install-ProjectTemplate.ps1
@@ -1,40 +0,0 @@
-param([switch]$uninstall)
-
-$install = -not $uninstall
-
-# Setting some values we'll need later.
-$currentDir = split-path -parent $MyInvocation.MyCommand.Definition
-$vsToolsDir = $Env:VS100COMNTOOLS
-$vsProjTemplatePath = Join-Path $vsToolsDir ..\IDE\ProjectTemplates\CSharp\Web\1033\
-$devenvPath = Join-Path $vsToolsDir ..\IDE\devenv.exe
-$installTemplatesCommand = $devenvPath + " /installvstemplates"
-$is64 = ($ENV:Processor_Architecture -eq 'x86' -and (test-path env:\PROCESSOR_ARCHITEW6432)) -or ($ENV:Processor_Architecture -eq 'AMD64')
-$regDir = Join-Path $currentDir reg
-$projName = 'ReallyEmptyMvcWebApplicationProjectTemplatev3.01.cshtml'
-$templateDir = Join-Path $currentDir $projName
-$zipFileName = $projName + '.zip'
-$zipFile = Join-Path $templateDir $zipFileName
-$templateZipFile = Join-Path $vsProjTemplatePath $zipFileName
-$7zPath = Join-Path $currentDir \tools\7za.exe
-
-$arch = 'x86'
-if ($is64) {
- $arch = 'x64'
-}
-
-# Actual work.
-if ($install) {
- & $7zPath a -tzip -mx9 $zipFile $templateDir/**
- Copy-Item $zipFile $vsProjTemplatePath
- Remove-Item $zipFile
- regedit.exe /S $regDir\install-$arch.reg
- & $devenvPath /installvstemplates
-}
-else {
- if (Test-Path $templateZipFile) {
- Remove-Item $templateZipFile
- }
- regedit.exe /S $regDir\uninstall-$arch.reg
- & $devenvPath /installvstemplates
-}
-
View
14 README.md
@@ -4,14 +4,12 @@ This is a much emptier project template for ASP.NET MVC 3. The concepts here are
# Installation
* __MAKE SURE ALL INSTANCES OF VISUAL STUDIO ARE CLOSED!__
-* Run the `install.cmd` batch file to install the project template. This will run the `Install-ProjectTemplate.ps1` powershell script.
+* Run the 'build.cmd' batch file to make the VSIX installer for the template. Then copy that file to your Visual Studio installation and double-click the .vsix file to install.
The batch file:
* Creates the project package (a zip file).
-* Copies the file to the correct Visual Studio project templates directory.
-* Adds a registry entry for the project template that ASP.NET MVC 3 picks up. The script handles x86 and x64 cases.
-* Registers it with Visual Studio using `devenv /installvstemplates`. This can take a while.
+* Packages the template up in the Visual Studio installer extensible package (VSIX).
# DISCLAIMER
I've tested this on my machine, but not yours. I make no guarantees that it'll work fine. See the license at the end.
@@ -19,13 +17,7 @@ This code is being made available to you under the [MIT license](http://www.open
# Credits
* [7-Zip](http://www.7-zip.org/) used to archive the template into a zip file.
-
-# TODO
-Hey, if you'd like to help make this better, consider one of the following. :)
-
-* Make script auto-detect whether VS is running or not and do the right thing.
-* Test this on an x86 machine
-* Write an installer for this.
+* [Tim Heuer](http://timheuer.com/blog/) or the VSIX installer.
# License
Copyright (c) 2012 Phil Haack
View
11 ReallyEmptyMvc3ProjectTemplate.pkgdef
@@ -0,0 +1,11 @@
+[$RootKey$\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate]
+"Title"="Really Empty"
+"Description"="This is the most emptiest MVC 3 project template made ever."
+
+[$RootKey$\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#]
+
+[$RootKey$\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#\Razor]
+"Path"="CSharp\\Web"
+"SupportsHTML5"=dword:00000000
+"SupportsUnitTests"=dword:00000000
+"Template"="ReallyEmptyMvc3ProjectTemplate.zip"
View
BIN  ReallyEmptyMvc3ProjectTemplate.vsix
Binary file not shown
View
1  [Content_Types].xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="vsixmanifest" ContentType="text/xml" /><Default Extension="pkgdef" ContentType="text/plain" /><Default Extension="txt" ContentType="text/plain" /><Default Extension="zip" ContentType="application/zip" /></Types>
View
10 build.cmd
@@ -0,0 +1,10 @@
+@echo off
+cd %~dp0
+cd ReallyEmptyMvcWebApplicationProjectTemplatev3.01.cshtml
+REM create the project template zip
+..\tools\7za.exe a -tzip -mx9 ..\ProjectTemplates\CSharp\Web\ReallyEmptyMvc3ProjectTemplate.zip *
+pushd %~dp0
+REM create the VSIX file based on the zip and manifest data
+tools\7za.exe a -tzip -mx9 ReallyEmptyMvc3ProjectTemplate.vsix @vsixfiles.txt
+REM delete the temporary zip
+rmdir /s /q ProjectTemplates
View
30 extension.vsixmanifest
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
+ <Identifier Id="ReallyEmptyMvc3.CSharp.A2634C4B-310F-4F57-9690-BDE944C18A8E">
+ <Name>ReallyEmptyMvc3ProjectTemplate</Name>
+ <Author>Phil Haack</Author>
+ <Version>3.01</Version>
+ <Description xml:space="preserve">This is a much emptier project template for ASP.NET MVC 3.</Description>
+ <Locale>1033</Locale>
+ <License>license.txt</License>
+ <SupportedProducts>
+ <VisualStudio Version="10.0">
+ <Edition>Ultimate</Edition>
+ <Edition>Premium</Edition>
+ <Edition>Pro</Edition>
+ <Edition>VWDExpress</Edition>
+ </VisualStudio>
+ <VisualStudio Version="11.0">
+ <Edition>Ultimate</Edition>
+ <Edition>Premium</Edition>
+ <Edition>Pro</Edition>
+ <Edition>VWDExpress</Edition>
+ </VisualStudio>
+ </SupportedProducts>
+ <SupportedFrameworkRuntimeEdition MinVersion="2.0" MaxVersion="4.0" />
+ </Identifier>
+ <Content>
+ <VsPackage>ReallyEmptyMvc3ProjectTemplate.pkgdef</VsPackage>
+ <ProjectTemplate>ProjectTemplates</ProjectTemplate>
+ </Content>
+</Vsix>
View
2  install.cmd
@@ -1,2 +0,0 @@
-cd %~dp0
-Powershell -ExecutionPolicy Unrestricted %~dp0Install-ProjectTemplate.ps1
View
7 license.txt
@@ -0,0 +1,7 @@
+Copyright (c) 2012 Phil Haack
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
13 reg/install-x64.reg
@@ -1,13 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate]
-"Title"="Really Empty"
-"Description"="This is the most emptiest MVC 3 project template made ever"
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#]
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#\Razor]
-"Path"="CSharp\\Web"
-"SupportsHTML5"=dword:00000000
-"SupportsUnitTests"=dword:00000000
-"Template"="ReallyEmptyMvcWebApplicationProjectTemplatev3.01.cshtml.zip"
View
14 reg/install-x86.reg
@@ -1,14 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate]
-"Title"="Really Empty"
-"Description"="This is the most emptiest MVC 3 project template made ever."
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#]
-
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate\C#\Razor]
-"Path"="CSharp\\Web"
-"SupportsHTML5"=dword:00000000
-"SupportsUnitTests"=dword:00000000
-"Template"="ReallyEmptyMvcWebApplicationProjectTemplatev3.01.cshtml.zip"
View
3  reg/uninstall-x64.reg
@@ -1,3 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate]
View
3  reg/uninstall-x86.reg
@@ -1,3 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\MVC3\ProjectTemplates\ReallyEmptyMvcProjectTemplate]
View
1  uninstall.cmd
@@ -1 +0,0 @@
-Powershell -ExecutionPolicy Unrestricted %~dp0Install-ProjectTemplate.ps1 -uninstall
View
5 vsixfiles.txt
@@ -0,0 +1,5 @@
+ProjectTemplates\CSharp\Web\ReallyEmptyMvc3ProjectTemplate.zip
+extension.vsixmanifest
+license.txt
+ReallyEmptyMvc3ProjectTemplate.pkgdef
+[Content_Types].xml
Something went wrong with that request. Please try again.