单击“使用法师通过文件共享" [英] Click Once using mage over fileshare

查看:68
本文介绍了单击“使用法师通过文件共享"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个脚本,可通过mage.exe将click部署到文件共享.
\\服务器名\共享名

当我尝试从共享启动exe时,它说找不到网络路径.
但是我可以从我的机器浏览到该路径.
这是我的Powershell脚本.

参数(
[switch] $ help,
[string] $ env = {}#env的名称

)


if($ help){
用法:updatePublishPremiumNetClient.ps1 -env"
出口0
}

if($ env.Length -eq 0){
请输入环境名称."
1号出口
}

if($ env -eq"IT"){
$ Drive ="\\ server \ ClickOnce"
}




$ NewString ="PremiumNet测试"


$ buildOutput ="G:\ TFS \ PremiumNet \ Trunk \ Build \ PNClient"
写输出$ buildOutput

$ oldPath =获取内容Env:\ Path;
$ newPath = $ oldPath +; C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin";

设置内容Env:\ Path $ newPath;
$ certificateFile ="PremiumNet.Desktop_1_TemporaryKey.pfx"
$ magePath ="C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin"

$ publishVersion = $ version;
$ publishLocation = $ Drive;

#为新版本创建文件夹
New-Item -Path $ publishVersion -ItemType目录-Force

复制-recurse $ buildOutput \ * $ publishVersion


& "C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin \ NETFX 4.0 Tools \ mage.exe"-新建应用程序-ToFile $ publishVersion \ PremiumNet.Desktop.exe.manifest-名称"PremiumNet-$ env"-版本$ publishVersion -FromDirectory $ publishVersion

& "C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin \ NETFX 4.0 Tools \ mage.exe" -Sign $ publishVersion \ PremiumNet.Desktop.exe.manifest -CertFile $ certificateFile

& "C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin \ NETFX 4.0 Tools \ mage.exe"-更新PremiumNet.Desktop.application-名称"PremiumNet-$ env"-版本$ publishVersion -AppManifest $ publishVersion \ PremiumNet.Desktop.exe.manifest -providerUrl $ publishLocation \ PremiumNet.Desktop.application -install tr​​ue

& "C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ bin \ NETFX 4.0 Tools \ mage.exe" -Sign PremiumNet.Desktop.application -CertFile $ certificateFile

Hi All,

I have a script which deploys click once to a file share via mage.exe.
\\Servername\Sharename

When i try to launch the exe from the share it says network path not found.
However i am able to browse to that path from my machine.
Here is my Powershell Script.

param (
[switch]$help,
[string]$env = {} # Name of the env

)


if ( $help ) {
"Usage: updatePublishPremiumNetClient.ps1 -env "
exit 0
}

if ( $env.Length -eq 0 ) {
"Please enter env name."
exit 1
}

if ( $env -eq "IT" ) {
$Drive="\\server\ClickOnce"
}




$NewString="PremiumNet Test"


$buildOutput = "G:\TFS\PremiumNet\Trunk\Build\PNClient"
write-output $buildOutput

$oldPath = get-content Env:\Path;
$newPath = $oldPath + ";C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin";

set-content Env:\Path $newPath;
$certificateFile = "PremiumNet.Desktop_1_TemporaryKey.pfx"
$magePath = "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin"

$publishVersion=$version;
$publishLocation = $Drive;

#Create folder for the new version
New-Item -Path $publishVersion -ItemType Directory -Force

copy -recurse $buildOutput\* $publishVersion


& "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\mage.exe" -New Application -ToFile $publishVersion\PremiumNet.Desktop.exe.manifest -Name "PremiumNet - $env" -Version $publishVersion -FromDirectory $publishVersion

& "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\mage.exe" -Sign $publishVersion\PremiumNet.Desktop.exe.manifest -CertFile $certificateFile

& "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\mage.exe" -Update PremiumNet.Desktop.application -Name "PremiumNet - $env" -Version $publishVersion -AppManifest $publishVersion\PremiumNet.Desktop.exe.manifest -providerUrl $publishLocation\PremiumNet.Desktop.application -install true

& "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\mage.exe" -Sign PremiumNet.Desktop.application -CertFile $certificateFile

推荐答案

帮助,
[string]
help,
[string]


env = {}#env的名称

)


如果(
env = {} # Name of the env

)


if (


help){
用法:updatePublishPremiumNetClient.ps1 -env"
出口0
}

如果(
help ) {
"Usage: updatePublishPremiumNetClient.ps1 -env "
exit 0
}

if (


这篇关于单击“使用法师通过文件共享"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆