How to configure VS 2017 offline installer/layout so that it doesn't need an internet connection at all? - visual-studio-2017

I was able to create an offline installer with a command line like:
vs_enterprise__873301792.1489161815.exe --layout %CD%\vs2017offline --lang en-US
I got about 20 GB out of this (1901 files).
but, as it is already known, the Visual Studio installer needs an internet connection at least to initialize, even with such an offline layout.
(But it doesn't need to download the packages already existing in the layout/image, so it saves really download volume.)
In the MS web documentation for VS more parameters are mentioned:
https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio
AFAIK, nobody figured out how to use them to guarantee really an offline install without internet connection (it seems quite likely to me that channel and/or catalog have to be redirected for hindering VS installer to go online).
Has anyone?
Here are the parameters, which I mean:
--channelId Optional: The ID of the channel for the instance that will be installed. This is required for the install command, ignored for other commands if --installPath is specified.
--channelUri Optional: The URI of the channel manifest. This can be used for the install command; it is ignored for other commands.
--installChannelUri Optional: The URI of the channel manifest to use for the installation. The URI specified by --channelUri (which must be specified when --installChannelUri is specified) will be used to detect updates. If updates are not desired, --channelUri must be specified without an argument. This can be used for the install command; it is ignored for other commands.
--installCatalogUri Optional: The URI of the catalog manifest to use for the installation. If specified, the channel manager will attempt to download the catalog manifest from this URI before using the URI in the install channel manifest. This parameter is used to support offline install, where the layout cache will be created with the product catalog already downloaded. This can be used for the install command; it is ignored for other commands.
In the layout directory, there exist files like catalog.json, channelmanifest.json, response.json, vs_installer_version.json among others. Any idea?

You don't need to do anything special for the offline installer to work without any Internet connection. Even though channelURI in <offline folder>\Response.json points online, it will not try to update the component list or something each time, you need to explicitly request an update for that.
The only thing you need to make sure is to select a language that you have downloaded files for on the "Language packs" tab when selecting components -- otherwise, it will try to download the missing bits.
The installer will still try to access the Net
to post telemetry to https://dc.services.visualstudio.com/v2/track and https://vortex.data.microsoft.com/collect/v1 from Microsoft.VisualStudio.Telemetry.Net35.dll that's a part of the installer
to retrieve CRLs for relevant signing certificates from https://crl.microsoft.com
but both are optional, the installer won't fail it it can't do either -- I've just successfully installed stuff with a disabled network connection.

For an offline installer to work you need to 'fake' out the installer to make it think there is an Internet connection, but with bad connectivity.
To do this you need to add various addresses to your local 'hosts' file.
See Visual Studio 2017 Enterprise Offline Installation Fails for a list of names to add to your hosts file.

I tried installing certificates, different layout parameters for cache folder but none of them worked. I solved the issue by running vs_setup.exe in the cache folder, instead of running vs_community.exe with parameters.

Related

Visual Studio 2017 2 users on one desktop

I have the following problem: I have a Laptop with two different user accounts (UserA & UserB / they belong to the same person but have different priveleges).
UserA: can build the solution and run tests locally (Everything is working as expected)
UserB: Has the rights to publish to the specific network drive, however he cannot build the project. The reason is that the Windows user itself has not the correct proxy settings configured, and thats why the nuget packages cannot be downloaded.
I have no possibility to change the proxy settings for UserB right now (It depends on internal processes, which might take a while)
However I would have expected, that when I build the solution with UserA, UserB would not need to build it again and just can publish it. This, does not work, as soon as I want to publish, VS tries to rebuild the solution and this does not work because some dependencies are missing and cannot be loaded.
Is there any solution for this problem? I tried to make a research, however I was not really sure for the correct keywords to search for.
Edit: I have now the domain added to my UserB, but I still have some other problems. However I found out that this article is heavily related to my issue: Unable to launch Visual Studio 2015 as a different user.
When I start Visual Studio via Command Line with the mentioned arguments, more works, however I am now not able any longer to connect to my database using Integrated Security = true in the connection string. But at least I can build now. Deploying also works but I just get a 500 Server error when I try to connect to the resource.
Edit2: I needed to add the domain to my user when opening Visual Studio with the command mentioned in the link above. This fixed my problem with connecting to the database.
Actually I do not need an answer anymore for my initial question but I will not delete it because maybe someone has an answer for a person who will have the same question later on.

Configure processing server role with config patches

The Sitecore documentation provides some pretty clear instructions on how to configure a Sitecore instance as a processing server:
https://doc.sitecore.net/sitecore_experience_platform/xdb_configuration/configure_a_processing_server
However, many of those steps require enabling/disabling of files manually on the installed server. Has anybody seen or built a patch file (similar to SwitchMasterToWeb) that can disable/enable the appropriate functionality as a patch? I would rather not touch the default Sitecore install and instead rely on automated deployment of configuration patches.
I haven't seen this as a patch and not sure if its possible to do this with just one patch (would love to be proved wrong), but for something like this I've used a Powershell script.
I set up Octopus Deploy to run a Powershell script step after deploy to disable files and change settings if patch files can't do the job.
I can highly recommend the Powercore tools for this kind of thing.
https://github.com/adoprog/Sitecore-PowerCore/tree/master/Framework/ConfigUtils
If anybody else winds up looking for this, I've posted some work up on GitHub for patch files for a variety of versions for 8.0:
https://github.com/jst-cyr/Sitecore-Role-Configs
The patches there will do the 'disable/enable/change' for authoring, delivery, or processing. I don't have one for the reporting server.
Sitecore has evaluated POC for same. At this point of time applciable for Sitecore CMS 8.1 rev. 160302 (Update-2). See here-
https://github.com/Sitecore/Sitecore-Configuration-Roles

Deploy multiple Content Delivery Servers with same confguration

I am building out a Sitecore farm with multiple Content Delivery servers. In the current process, I stand up the CD server and go through the manual steps of commenting out connection strings and enabling or disabling config files as detailed here per each virtual machine/CD server:
https://doc.sitecore.net/Sitecore%20Experience%20Platform/xDB%20configuration/Configure%20a%20content%20delivery%20server
But since I have multiple servers, is there any sort of global configuration file where I could dictate the settings I want (essentially a settings template for CD servers), or a tool where I could load my desired settings/template for which config files are enabled/disabled etc.? I have used the SIM tool for instance installation, but unsure if it offers the loading of a pre-determined "template" for a CD server.
It just seems in-efficient to have to stand up a server then config each one manually versus a more automated process (ex. akin to Sitecore Azure, but in this case I need to install the VMs on-prem).
There's nothing directly in Sitecore to achieve what you want. Depending on what tools you are using then there are some options to reach that goal though.
Visual Studio / Build Server
You can make use of SlowCheetah config transforms to configure non-web.config files such as ConnetionStrings and AppSettings. You will need a different build profiles for each environment you wish to create a build for and add the appropriate config transforms and overrides. SlowCheetah is available as a nuget package to add to your projects and also a Visual Studio plugin which provides additional tooling to help add the transforms.
Continuous Deployment
If you are using a continuous deployment tool like Octopus Deploy then you can substitute variables in files on a per environment and machine role basis (e.g. CM vs CD). You also have the ability to write custom PowerShell steps to modify/transform/delete files as required. Since this can also run on a machine role basis you can write a step to remove unnecessary connection strings (master, reporting, tracking.history) on CD environments as well as delete the other files specified in the Sitecore Configuration Guide.
Sitecore Config Overrides
Anything within the <sitecore> node in web.config can be modified and patch using Include File Patching Facilities built into Sitecore. If you have certain settings which need to be modified or deleted for a CD environment then you can create a CD-specific override, which I place in /website/App_Config/Include/z.ProjectName/WebCD and use a post-deployment PowrrShell script in Octopus deploy to delete this folder on CM environment. There are example of patches within the Include folder, such as SwitchToMaster.config. In theory you could write a patch file to remove all the config sections mentioned in the depoyment guide, but it would be easier to write a PowerShell step to delete these instead.
I tend to use all the above to aid in deploying to various environments for different server roles (CM vs CD).
Strongly recommend you take a look at Desired State Configuration which will do exactly what you're talking about. You need to set up the actual configuration at least once of course, but then it can be deployed to as many machines as you'd like. Changes to the config are automatically flowed to all machines built from the config, and any changes made directly to the machines (referred to as configuration drift) are automatically corrected. This can be combined with Azure, which now has capability to act as a "pull-server" through the Automation features.
There's a lot of reading to do to get up to speed with this feature-set but it will solve your problem.
This is not a Sitecore tool per se.

Publishing to ProGet and I can't see any packages

I'm trying to set up a NuGet server using ProGet and am hitting a brick wall when publishing a package and it doesn't appear in the feed. The package is written to disk and works in other NuGet feeds. Other packages also don't appear in the ProGet feed so I'm pretty certain that the package is fine and that the problem lies with ProGet.
I'm using the community version of ProGet, but I don't see why that would affect anything.
Any ideas are most welcome!
The ProGet service is responsible for indexing packages, so if it's not running, packages could be uploaded but not displayed in any feeds. Here are the common troubleshooting steps for this scenario:
Verify that the ProGet Windows service (INEDOPROGETSVC) is running.
Ensure that the user account hosting the ProGet service has access to the feed storage path. Since it is NETWORK SERVICE by default, it would not see your mapped drives, and may not have access to the UNC path where the packages are stored.
Try running the ProGet service interactively, i.e. stop the ProGet Windows service and run ProGet.Service.exe manually as a console application to see any live output. Remember to restart the ProGet service when you close the console application.
Check for feed indexing errors to see if there was a problem indexing a particular packages. I know in much older versions that single "poisoned" packages (bad .nuspec file, invalid directory structure, etc.) could halt the indexing altogether.
Thanks John Rasch, found that your first point gave me what i needed to look in the right direction.
I could not find the (INEDOPROGETSVC) service but I did find (ProGet Servie) - I restarted this and then refreshed the my feed and all the missing packages showed up.
My version of ProGet is v3.3.12
Thanks John.

How to run my own C++ source files in the installation wizard?

I have created a windows install deployment for my C++ application using VS2010. However my problem is that I don't know how can I squeeze in some of my own code to the installation wizard (and is it possible at all?). The problem is that during installation I want:
ask the user to provide his installation key,
grab the hardware fingerprint (I already have an algorithm for that with WMI),
sent both keys using my own c++ communication libraries (so NOT the browser),
continue the installation after receiving a confirmation from the server.
Moreover, this would require adding custom items to the installation wizard like the input field for installation key, or pop up boxes witch error warring like:
Couldn't connect to the server. Please check your internet connection before continuing with the installation.
So it's in fact a 2 level question:
How to run my C++ source files during the installation wizard?
How to add custom element to the installation wizard GUI?
So far it has been hard to find anything helpful in Google. :/
Check Windows Installer, more specifically Custom Actions:
The developer of an installer package may write code to serve their own purpose, delivered in a DLL. This can be executed during the installation sequences, including when the user clicks a button in the user interface, or during the InstallExecuteSequence. Custom Actions typically validate product license keys, or initialise more complex services. Developers should normally provide inverse custom actions for use during uninstallation.
Msiexec provides a way to break after loading a specified custom action DLL but before invoking the action.