VS2008项目使用Mage手动创建Clickonce包

当使用VS2008开发的项目使用Mage手动生成Clickonce包时,需要更新VS2008 SP1,然后按照我引用别人的方法就可以解决安装失败的情况

VS2008 Hotfix 方法:

http://www.cnblogs.com/Margin/archive/2008/10/22/1316559.html

手动生成Clickonce包的Batch Script:
@set PVersion=1.0.0.1
@set PackageName=SystemName
@set AppName=SystemName
@set publisher=DKSoft
@set Url=http://localhost/%AppName%
@set tmpPath=.\%PVersion%
@set PackagePath=.\Release%PVersion%
@SET Mode=Debug

@pushd.

@cd ..\Deploy

@if exist %tmpPath% RMDIR %tmpPath% /S /Q
@MKDIR %tmpPath%\bin

@if exist %PackagePath% RMDIR %PackagePath% /S /Q
@MKDIR %PackagePath%

if exist "%AppName%.application" del "%AppName%.application" /S /F /Q

@"%windir%\system32\xcopy" "..\bin\%Mode%\*.*" "%tmpPath%\bin\" /Y /R /S /Q

@del "%tmpPath%\bin\*.pdb" /S /F /Q
@del "%tmpPath%\bin\*.vshost.exe*" /S /F /Q
@del "%tmpPath%\bin\Microsoft.Practices.*.xml" /S /F /Q
@del "%tmpPath%\bin\Reports\*.repx" /S /F /Q
if exist "%tmpPath%\bin\%AppName%.application" del "%tmpPath%\bin\%AppName%.application" /S /F /Q
if exist "%tmpPath%\bin\%AppName%.exe.manifest" del "%tmpPath%\bin\%AppName%.exe.manifest" /S /F /Q

@mage -New Application -ToFile %tmpPath%\%AppName%.exe.manifest -Name "%AppName%" -Version %PVersion% -FromDirectory %tmpPath%\bin

@mage -Sign %PVersion%\%AppName%.exe.manifest -CertFile mykey.pfx

@mage -New Deployment -ToFile %AppName%.application -Name "%AppName%" -Version %PVersion% -AppManifest %PVersion%\%AppName%.exe.manifest -providerUrl %Url%/%AppName%.application -install true -Publisher "%publisher%"

@mage -Sign %AppName%.application -CertFile mykey.pfx

@"%windir%\system32\xcopy" "%tmpPath%\bin\*.*" "%PackagePath%\%PVersion%\" /Y /R /S /Q

@Copy "%AppName%.application" "%PackagePath%\" /Y

@Copy "%tmpPath%\%AppName%.exe.manifest" "%PackagePath%\%PVersion%\%AppName%.exe.manifest" /Y


@popd.

原文地址:https://www.cnblogs.com/Margin/p/1318270.html