Clickonce - Deploy on DVD, with offline installer - c#

i am using VS 2010 and i am having trouble with clickonce deployment.
My goal is to Distribute application on DVD for users without internet connection to be able to install it. So it needs to include full installer of .NET framework 3.5 Client profile.
However, i am unable to achieve this.
From VS 2010 i choose publish wizard:
Specify location to publish this applicaton:
C:\ something\ something - this folder i will burn later to CD
How will users install application?
From CD{DVD
the application will check for updates from following location:
http://13874.w74.wedos.net/
And that is it, Publish wizard ends here.
So i create some aditional options:
Options->deployment
-Enable autorun for CDs
-Disable creation of publish.htm page
If i publish app, it is deployed to specified folder on my disk and can be installed from there.
But how do i include offline version of .net framework installer (I am Targeting .NET Framework 3.5)?
Thank you.

I managed to found solution for part of my question - how to include offline installer for .NET Framework 3.5. However, second part of my question - how to manage updates remains unanswered.
How to include .NET Framework offline installer for 3.5:
Under prerequisites (Properties->Publish->Prerequisites) make sure you have .Net framework 3.5 SP1 checked
Check radiobutton "Download from same location as my application" in lower part of prerequisities dialog.
Download .NET 3.5 full redistributable here http://go.microsoft.com/fwlink?LinkID=118080
Here comes the main part. It is not enough to just have .net redistributable on same location as your app, there is slightly more to do.
Unpack contents of installer from command line (command - "dotNetFx35.exe /x")
Choose directory to unpack via dialog shown.
Copy CONTENTS of subdirectory WCU\dotNetFramework to
a)x86 systems: %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1
b)x64 systems: %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1
In the same locations there should be xml file prduct.xml, edit it as folows:
A) Paste the following into the < PackageFiles > element:
B) Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001
C) Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-amd64-en-US.exe" and change the PublicKey value to the same as in step above
Save the product.xml file
Thats it. Before that, when you attemp to publish it from visual studio it throws errors that it is unable to find variaus parts of .net 3.5 framework. Now it should work fine.
More information at:
http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#General%20Issues
Section 2.3.1.1. - Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper package

Related

Visual Studio doesn't create start files

So I've just installed VS on a new machine & when creating a new project, none of the starting files are created. For instance when making an ASP.NET web app I just get left with a completely empty solution & when making a console app I get the starting code, but the project can't start because it's made outside of the solution... I guess...
I've tried reinstalling VS but no difference.
From the error message, I see that this issue appeared on .NET/.NET Core projects. So have you tried to create a project which is based on .NET Framework and see if it works for .NET Framework project?
“Error: The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json …”, it seems many causes for this error, but the key is unable to locate the .NET SDK.
So two mainly aspects: installation and path.
1). Navigate to C:\Program Files\dotnet\sdk and check if there lists different versions of SDK folders. Also type dotnet --list-sdks in CMD to make sure that all installed versions of dotnet SDK are listed. If there is no SDK listed, or some are missing, try to reinstall them.
2). Check the environment variable. Go to This PC(right-click) > Properties > Advanced system settings > Advanced > Environment Variables > System Variables > find Path > click Edit, and check if C:\Program Files\dotnet\ path is configured there. If not, try to add it and restart VS.
3). Other suggestions: try to install x86 version of SDK, repair Visual Studio, and refer to this similar thread: Visual Studio 2019 unable to locate .NET Core SDK.

Deploying visual studio 2012 c# windows application

i created a windows application that uses system.xml and system.io libraries, it reads and writes into a specific file (in same directory).
after i am done, i run the .exe file and its perfectly fine BUT when i tried it on any other computer, it gives an error and doesn't work(doesn't even open).
i think that i should attach some library files such as the xml library ?
I tried publishing as installation file and it also doesn't work
i don't know and don't know how to do that, please help.
System.XML and System.IO are part of the .NET Framework. Check which .NET Framework version your solution is compiled for (in the project settings in Visual Studio). Default for Visual Studio 2015 is the .NET Framework 4.5.2, which is not installed by default on Windows 7! You need to install it for your application to work, but you don't need to copy any DLLs manually.
You can find the official download here
https://www.microsoft.com/en-us/download/details.aspx?id=42642

How do I add prerequisites to a ClickOnce application?

I want to add prerequisites to my Click Once application. Here is the problem. The program is in a server and clients install the application from the specific URL. I want to auto install the prerequisites (for example, Crystal Report Viewer) when the user first downloads and installs it, how could I do that?
I'm using C# Windows Forms and .NET Framework 4.0
You need to create a prerequisite first. The prerequisites that are shown in Visual Studio are in the following location
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages
You can create a Product Manifest through this tutorial
Put it along with other bootstrapper packages.
Once this is done, you can select that prerequisite in your prerequisites window in publish settings and give the location from where you want the user to download it.
Here is a complete tutorial for creating Localized Bootstrapper Package.
There is a tool called Bootstrap Manifest Generator. This Code Project article is a complete tutorial for using this tool. I think this tool is not available from Microsoft directly any more.

Redistributable .net framework installer

Is there a redistributable web installer for .net framework 4.0? Preferably, it'd detect the correct language version to install and download it from the internet.
I want to bundle this web installer with my 4.0 application, so that the download size of setup package is as small as possible (40MB of full offline installer could scare users), plus I don't want to deal with detecting the necessary version (x86, x64, which language) to install.
EDIT:
As to how I create the setup. I'll go for the easiest option. My application is really trivial. I just need to copy some files and make shortcuts in Start Menu / Desktop.
What's the simplest/fastest solution to this? The setup project that can be build with VS (I'm using VS 2010).
Visual Studio setup project covers your needs.
check this : http://msdn.microsoft.com/en-us/library/ee942965.aspx
edit fixed the link, you might want to check the web bootstrapper and redistribute framework related sections
Within your setup project you should embed the .Net 4 Framework. But instead of adding the full offline version you simply download and embed this web installer. It checks the currently running machine and downloads only the necessary files. So everyone who already has the .Net framework installed just gets 870kb of death data with your setup (thats the size of the web installer) and anybody else downloads as much as needed for the current machine.

Failing Build because it can't find AL.exe

Here's an interesting problem that really has me scratching my head. I have a project that's being built in TeamCity. It's been working fine until a developer added a resource file to one of the projects with some strings for another locale. He's added the .resx file under the Properties folder next to the default one. Here's the error message from the build log:
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2105, 9):
error MSB3091: Task failed because "AL.exe" was not found, or the correct
Microsoft Windows SDK is not installed. The task is looking for "AL.exe" in the "bin"
subdirectory beneath the location specified in the InstallationFolder value
of the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A.
You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5.
2) Install Visual Studio 2008.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task.
There are a number of things here that I can't work out.
- How come it can find AL.exe for the default .resx file but not for this new one?
- Why's it looking in a registry key that looks Vista-specific, when the build is running on Server 2003?
Any ideas?
Problem solved by installing Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1.
I don't understand how MSBuild got out of step with its tools, perhaps I never will discover the reason, but installing that SDK fixed the problem for me.
Check msbuild from x86 is used. There should be an option in TeamCity build runner.
Was VS2008 installed on the machine?
Make sure the Windows SDK is completely installed on the server. AL.exe (Assembly Linker) is included with the .NET SDK (not the runtime).
(I have the same problem on my TFS server with ClickOnce, but too lazy to fix)

Categories

Resources