-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevInstall.cmd
More file actions
101 lines (69 loc) · 4.14 KB
/
DevInstall.cmd
File metadata and controls
101 lines (69 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
@ECHO OFF
ECHO.Usage: DevInstall.cmd [/u][/debug]
ECHO.This script requires Administrative privileges to run properly.
ECHO.Start - All Programs - Accessories - Right-Click Command Prompt - Select 'Run As Administrator'
set CompanyName=Nelinory
set AssemblyName=MyForecast
set RegistrationName=Registration
set ProgramImage=myForecast.png
set ProgramImageInactive=myForecastInactive.png
set ProgramImageStrip=myForecastStrip.png
set ProgramImageStripInactive=myForecastStripInactive.png
set GACUtilPath=%ProgramFiles(x86)%
ECHO.Determine whether we are on an 32 or 64 bit machine
if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86
set ProgramFilesPath=%ProgramFiles(x86)%
goto unregister
:x86
ECHO.On an x86 machine
set ProgramFilesPath=%ProgramFiles(x86)%
:unregister
ECHO.*** Unregistering and deleting assemblies ***
ECHO.Unregister and delete previously installed files (which may fail if nothing is registered)
ECHO.Unregister the application entry points
%windir%\ehome\RegisterMCEApp.exe /allusers "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\%RegistrationName%.xml" /u
ECHO.Remove the assemblies from the Global Assembly cache
"%GACUtilPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /u "%AssemblyName%"
"%GACUtilPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /u "%AssemblyName%.resources"
ECHO.Delete the folder containing the DLLs and supporting files (silent if successful)
rd /s /q "%ProgramFilesPath%\%CompanyName%\%AssemblyName%"
REM Exit out if the /u uninstall argument is provided, leaving no trace of program files.
if "%1"=="/u" goto exit
:releasetype
if "%1"=="/debug" goto debug
set ReleaseType=Release
goto checkbin
:debug
set ReleaseType=Debug
:checkbin
if exist ".\bin\%ReleaseType%\%AssemblyName%.dll" goto register
ECHO.Cannot find %ReleaseType% binaries.
ECHO.Build solution as %ReleaseType% and run script again.
goto exit
:register
ECHO.*** Copying and registering assemblies ***
ECHO.Create the path for the binaries and supporting files (silent if successful)
md "%ProgramFilesPath%\%CompanyName%\%AssemblyName%"
ECHO.Copy the binaries to program files
copy /y ".\bin\%ReleaseType%\%AssemblyName%.dll" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Copy the registration XML to program files
copy /y ".\Setup\%RegistrationName%.xml" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Copy the program image to program files
copy /y ".\Images\%ProgramImage%" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Copy the program inactive image to program files
copy /y ".\Images\%ProgramImageInactive%" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Copy the program image strip to program files
copy /y ".\Images\%ProgramImageStrip%" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Copy the program inactive strip image to program files
copy /y ".\Images\%ProgramImageStripInactive%" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\"
ECHO.Make the folders for the localization assemblies inside program files
md "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\fr"
ECHO.Copy the localization assemblies to program files
copy /y ".\bin\%ReleaseType%\fr\%AssemblyName%.resources.dll" "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\fr\"
ECHO.Register the main assembly with the global assembly cache
"%GACUtilPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /if "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\%AssemblyName%.dll"
ECHO.Register the localization assemblies with the global assembly cache
"%GACUtilPath%\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /if "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\fr\%AssemblyName%.resources.dll"
ECHO.Register the application with Windows Media Center
%windir%\ehome\RegisterMCEApp.exe /allusers "%ProgramFilesPath%\%CompanyName%\%AssemblyName%\%RegistrationName%.xml"
:exit