Struggling to integrate publish into our existing deployment mode

I’m trying to figure how to do our deployments. We already have a 1.1 No Touch Deployment (NTD) application and are converting to ClickOnce. Our exsiting application uses NTD for both a client embedded in the browser and launching an application. The launched applications have been turned into ClickOnce appsbut the embedded Client will continue to use NTD.
In our 1.1 development environment, we have 3 end projects that are involved in our deployment process. The Insight and Player projects build our executables, while the Deployment project copies these executables, support files and the dll’s required for our embeddedWinForms component.BTW the embedded component just reuses thedll’s from the Player project.

When the deployment project (it is just annmake file run as post-build event on a dummy project) is run we delete everything in the existing deployment and copy all the files over a new.BTW we need to keep the deployment project since we still need to copy the components for the embedded Client. A copy is attached to give you an idea of what I’m trying to hook into.

Now I’m trying to fit the new world of ClickOnce into our existing way of doing things and I confused

1) When are new versions of the application published? When the code changes? When the publish version changes?(It appears the later).

2) Am I correct in assuming that publish isonly available as a post build step on a project that produces an exe?This guess comes from reading the detailed output of MS-Build – I don’t see any executable called when a publish operation happens.

3) If this is really the case then what role does the mageui tool play? From what I can tell the .manifest and .application files are generated every time a publish operation happens – so I don’t see how it’s useful to edit them with mage.

4) Is there any way to use macros for publish location and other file paths/URL’s in the Publish panel? In particular I would like to use the $(ConfigurationName) macro so that we can continue our practice of having separate publish locations for our debug and release code.

Given my confusion I’m having trouble revising our system so that we can ensure the promises of our deployment project are met
a) Old published applications are always deleted.
b) There is always a published application available after the deployment project is run.

Doing what we currently do – deleting the deployment directory every time the deployment is run, will mean that sometimes we have no published version of our apps – since running a deployment will not cause a publish operation to happen.

In an ideal world you would tell me that my assumption in #2 (publish is only available as a post-build step) is wrong and there something I can call from mynmake file to run a publish operation. If that’s not possible then a way to force publish every time the Insight/Player projects are rebuilt – would be okay (a poor second choice – but it guarantees that we would always have an up-to-date copy of the application for publishing). Failing that any suggestion that allows me to preserve the promises of our deployment project would be useful

Thanks
Mark Levison

-

#
# This makefile defines various targets that create a deployment directory
# with Databeacon Smart Client setup correctly to run locally or over the web
#
# Suppresses command output; comment this out when debugging
.SILENT :
# Turn off built in inference rules
.SUFFIXES :
# Check if required macros were passed in to makefile
!IF !DEFINED(SolutionDir)
!error SolutionDir not defined
!ENDIF
!IF !DEFINED(ProjectDir)
!error ProjectDir not defined
!ENDIF
!IF !DEFINED(ConfigurationName)
!error ConfigurationName not defined
!ENDIF
##################################################################################
# Define a macro to recursively call a target in this makefile
MakeRecurse=\
$(MAKE) /nologo /s /f $(ProjectDir)\_ClientDeployment.mak \
/$(MAKEFLAGS) \
SolutionDir=$(SolutionDir) \
ProjectDir=$(ProjectDir) \
ConfigurationName=$(ConfigurationName)
# Init various directory vars
DeploymentBuildDirectory=$(ProjectDir)\build\$(ConfigurationName)\_ClientDeployment
DeploymentDirectory=C:\rohan_deployment\$(ConfigurationName)
ClientDeploymentDirectory=$(DeploymentDirectory)\smartclient
WebServiceDeploymentDirectory=$(DeploymentDirectory)\bin
ExamplesDirectory=$(SolutionDir)\examples
ExamplesDeploymentDirectory=$(DeploymentDirectory)\examples
HelpDirectory=$(SolutionDir)\documentation
HelpDeploymentDirectory=$(DeploymentDirectory)\help
BldDirectory=$(SolutionDir)\bld
BldToolsDirectory=$(BldDirectory)\tools
# Init signing vars
CertificatesDirectory=$(BldDirectory)\antfiles\certificates
KeyPairFile=$(CertificatesDirectory)\DarwinKeyPair.snk
CertficateFile=$(CertificatesDirectory)\mycert.spc
PrivateKeyFileFile=$(CertificatesDirectory)\mykey.pvk
VeriSignTimeStampURL=http://timestamp.verisign.com/scripts/timstamp.dll
# Init Demeanor vars
DemeanorConfigFile=$(BldDirectory)\antfiles\obfuscation\smart_client_obfuscate.xml
DemeanorOutputDirectory=$(DeploymentBuildDirectory)\demeanor
# Define this param when verisign is up and running
#SIGN=true
##################################################################################
# The list of deployed client assembly files
ClientDeployedAssemblies =\
insightlauncher.exe \
playerlauncher.exe \
player.exe \
insight.exe \
webclients.dll \
clientlib.cab \
commonlib.cab \
dotnetxlayer.cab \
engine.cab \
insightlib.cab \
vjslibreplacement.cab

# The list of assemblies as they appear when just built (same as
# above list but all .dll's instead of cab's)
ClientBuildAssemblies=$(ClientDeployedAssemblies:cab=dll)
# The list of web service assemblies
WebServiceAssemblies =\
fileservercore.dll \
jwebservices.dll \
netbridge.dll \
netwebservices.dll \
reportcommon.dll
all: deployment_directory_setup client_deployment webservice_deployment examples help
echo ========
echo Clearing Global Assembly Cache download area...
"$(BldToolsDirectory)\fusionnuker.exe" /silent
deployment_directory_setup:
xcopy /q /y SmartClientApp.res $(DeploymentBuildDirectory)
cd "$(DeploymentBuildDirectory)"
set PATH=$(BldToolsDirectory);$(VS80COMNTOOLS)\deployment\vspkgs;$(DEMEANOR_HOME)\demeanor;$(PATH)
echo ========
echo Creating deployment directories...
-rd /s /q $(DeploymentDirectory)
-mkdir "$(DeploymentDirectory)" 2> nul
-mkdir "$(WebServiceDeploymentDirectory)" 2> nul
-mkdir "$(ClientDeploymentDirectory)" 2> nul
client_tools:
echo ========
echo Copying FusionNuker...
xcopy /q "$(BldToolsDirectory)\fusionnuker.exe" "$(ClientDeploymentDirectory)"
client_required_files: client_app_settings
echo ========
echo Copying required files...
xcopy /q /y "$(ProjectDir)\files\runcode.txt" "$(ClientDeploymentDirectory)"
xcopy /q /y "$(ProjectDir)\files\*.msi" "$(ClientDeploymentDirectory)"
client_deployment : client_tools client_embed_icons client_strongname_files client_cab_files client_required_files client_sign_files
client_embed_icons :
echo ========
echo Embedding icons in executables...
ResHacker -add insightlauncher.exe,insightlauncher.exe,SmartClientApp.RES,,,
ResHacker -add playerlauncher.exe,playerlauncher.exe,SmartClientApp.RES,,,
ResHacker -add insight.exe,insight.exe,SmartClientApp.RES,,,
ResHacker -add player.exe,player.exe,SmartClientApp.RES,,,

client_cab_files :
echo ========
echo Generating .cab and .config files...
cd "$(DeploymentBuildDirectory)"
CabConfig webclients.dll "$(ClientDeploymentDirectory)" 2> nul
CabConfig insight.exe "$(ClientDeploymentDirectory)" 2> nul
CabConfig player.exe "$(ClientDeploymentDirectory)" 2> nul
xcopy /q /y *launcher.exe "$(ClientDeploymentDirectory)"
#
# Sign all the deployed files with Authenticode
#
client_sign_files :
echo ========
echo Digitally signing client assemblies...
echo =
cd "$(ClientDeploymentDirectory)"
for %i in ( $(ClientDeployedAssemblies) ) do \
@$(MakeRecurse) FileParameter=%i sign_file

#
# Re-strong name all the built files
#
client_strongname_files :
echo ========
echo Strong-naming client assemblies...
echo =
cd "$(DeploymentBuildDirectory)"
for %i in ( $(ClientBuildAssemblies) ) do \
@$(MakeRecurse) FileParameter=%i strongname_file
client_app_settings:
copy << $(ClientDeploymentDirectory)\appsettings.xml
<?xml version="1.0" encoding="utf-8" ?>
<settings>
<setting name="DetailsPath" value="/scripts/dbAccess5.exe"/>
<setting name="ReportStoreUri" value="/scripts/dbstore.exe"/>
<setting name="HelpPath" value="/Insight/Help/index.html"/>
<setting name="AuxiliaryPath" value="config.xml"/>
</settings>
<<KEEP
webservice_deployment : webservice_copy_files
webservice_copy_files :
echo ===
echo Copying report store assemblies...

xcopy /q /y "$(SolutionDir)\NetBridge\web.config" "$(DeploymentDirectory)"
-copy /Y "$(SolutionDir)\NetBridge\Store.aspx" "$(DeploymentDirectory)\store.aspx"
cd "$(DeploymentBuildDirectory)"
for %i in ( $(WebServiceAssemblies) ) do \
@xcopy /y "%i" "$(WebServiceDeploymentDirectory)\" 2> nul

examples :
echo ========
echo Copying examples folder...
xcopy "$(ExamplesDirectory)\*.*" "$(ExamplesDeploymentDirectory)" /s /e /r /i
-mkdir "$(ExamplesDeploymentDirectory)\images" 2> nul
-mkdir "$(ExamplesDeploymentDirectory)\index_files" 2> nul
xcopy /q /s /e /y "$(ProjectDir)\files\index.*" "$(ExamplesDeploymentDirectory)"
xcopy /q /s /e /y "$(ProjectDir)\files\images\*.*" "$(ExamplesDeploymentDirectory)\images"
xcopy /q /s /e /y "$(ProjectDir)\files\index_files\*.*" "$(ExamplesDeploymentDirectory)\index_files"

help :
echo ========
echo copying help files ...
-mkdir "$(HelpDeploymentDirectory)" 2> nul
-mkdir "$(HelpDeploymentDirectory)\smartclient" 2> nul
-mkdir "$(HelpDeploymentDirectory)\player" 2> nul
-mkdir "$(HelpDeploymentDirectory)\tours" 2> nul

unzip "$(HelpDirectory)\insight\help\Insight_WebHelp.zip" -d "$(HelpDeploymentDirectory)\smartclient"
unzip "$(HelpDirectory)\player\help\Player_WebHelp.zip" -d "$(HelpDeploymentDirectory)\player"

xcopy "$(HelpDirectory)\tours\*.*" "$(HelpDeploymentDirectory)\tours" /s /e /r /i


##################################################################################
#
# Target that signs the given $(FileParameter)
#
sign_file :
SignCode -spc "$(CertficateFile)" -v "$(PrivateKeyFileFile)" -n "Databeacon" -i "http://www.databeacon.com" "$(FileParameter)" > nul
!IF DEFINED(SIGN)
SignCode -x -t $(VeriSignTimeStampURL) -tr 5 "$(FileParameter)"
!ENDIF
echo + $(FileParameter) has been signed.

#
# Target that strong names the given $(FileParameter)
#
strongname_file :
Sn -q -R "$(FileParameter)" "$(KeyPairFile)"
echo + $(FileParameter) has been strong named.

[13950 byte] By [MarkLevison] at [2008-2-11]
# 1
As I discovered else where - what I really need was the secret sauce for calling msbuild. I can either call:
"msbuild projname.csproj /target:publish" or
create my own msbuild file that generate manifest(s) and bootstraper. The advantage to this -- it won't check to see all assemblies in my app need rebuilding (45-50 secs even if nothing needs to be rebuilt).
MarkLevison at 2007-9-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...