How to automatically rename the Application Files folder in a ClickOnce deployment

We are currently using Visual Studio to create our ClickOnce deployment packages, but we would like to rename the “Application Files” because the web server we use does not support spaces.

We found that if we go directly to the .application file, we can change the specified path, and we can also rename the folder manually.

Does anyone know how to automate this using MageUI or any other utility? It's tempting to just add a script package together, which makes a difference for us. The deployment also uses unsigned files, since we do not need to worry about the certificate (this is only an internal application)

+3
source share
2 answers

As no one seems to know the answer to this question, I found a way to do it myself. I created a powershell script. Please note that this will only work on unsigned manifests.

gci -Recurse -include *.application | ForEach-Object { [System.IO.File]::WriteAllLines($_.FullName, [System.IO.File]::ReadAllText($_.FullName).Replace("Application Files", "ApplicationFiles")) }
gci -recurse | Where {$_.psIsContainer -eq $true} | Where {$_.Name -eq "Application Files"} | ForEach-Object { $_.MoveTo($_.FullName.Replace("Application Files", "ApplicationFiles")) }

My strength is not surprising, so there may be a better way to do this, but that was what I came up with

+2
source

First try this manually.

Publishing the application to a folder (set the publishing location to something like C: \ publish and the installation URL is correct, for example, http: // myserver / myapp / ).

Then go in and rename the application files in ApplicationFiles to C: \ publish.

C:\publish\ApplicationFiles\yourapp_a_b_c_d\ yourapp.application. ( , , mageui , ).

MageUI ( c:\program files\microsoft sdks\windows\v7.0a\bin v6.0a\bin, , VS ).

MageUI "", c:\publish\ApplicationFiles\yourapp_a_b_c_d\yourapp.exe.manifest ( a_b_c_d - , yourapp - ).

. "". , " ..." , "" ( , , VS). /

.

clck , c:\publish\yourapp.application.

" ". " ". (C:\publish\ApplicationFiles\yourapp_a_b_c_d\yourapp.exe.manifest). , . (yourapp.application).

-, .

, , mageui Mage , , , " " "ApplicationFiles".

Mage, .

0

Source: https://habr.com/ru/post/1709217/


All Articles