-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide simple installation script #143
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! I like the idea in general. IMO the main use-case would be for first-time users that want to set up the profiler as quickly as possible. For this purpose, I think we can still improve it a bit. please see my comments.
@@ -0,0 +1,79 @@ | |||
@echo off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why make this a batch script? I hate them with a passion ;-) I'd much prefer powershell. Especially since this already uses some for loop magic and EnableDelayedExpansion that I can't understand without googling for an hour :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) I hate PS with a passion. Tbh, asked customer what they prefer and the answer was batch.
|
||
|
||
set InstallSource=%CD% | ||
for /f "delims=" %%x in (%InstallSource%\install.cfg) do ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that this is the part that magically reads in the install.cfg file. I'd prefer if the script prompted the user for these two questions (where to install - with a sane default directory) and whether to install the service instead of using the config file.
A config file would make sense if this needed to be automated but as this is a one-time install script I don't see the need. Asking the user makes it much more straight-forward for them to install the profiler. No documentation needed at all. Just run the script and it tells you what to do.
echo Installing Profiler to: "%InstallDir%" | ||
|
||
if exist "%InstallDir%" ( | ||
if "%InstallUploadService%"=="true" ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this? what if the user previously installed in a different directory? then this will do nothing and installing the service will still fail later on. I'd rather just not support the re-install case and instead add an uninstall.ps1 file that removes the daemon and prompts the user to manually delete the folder.
|
||
setx /m COR_PROFILER {DD0A1BB6-11CE-11DD-8EE8-3F9E55D89593} | ||
|
||
REM Enable the profiler globally (the actual profiling is disabled in the Profiler.yml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure the user has actually created a yml file. By default, this doesn't exist and I don't know what happens then. Possibly, all .NET processes are being profiled, which is probably not intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, ship with a "disable all" default config, though that might be confusing as we also ship with an example config.
Thanks for the comments! Although the basic install worked fine, it turned out for mass-rollout further tweaks were needed. Especially, you cannot execute scripts on network drives and so on. I'll have to update the PR with several tweaks. But tbh I think we should write a proper installer. I've used NSIS for this in the past. I'm pretty sure we can use it here as well. Last time I wrote an NSIS script was for CQSE RoomD, also with Windows Service :) |
@mpdeimos what is the status of this? Will there be progress or should we discard this? |
This PR provides an simple installation script for the profiler. However, I am not sure if it should be part of the official distribution, so maybe let's discuss this 1st and if we keep it what must be 1) documented and 2) which features are missing. We also have to decide on the default install directory.
Installation currently offers two steps:
Installation of the profiler for the whole system (and thus being configurable via YML). It will be installed in a way that 32bit, 64bit and DNX can be profiled at the same time.
Installation of the upload service.
The installation offers simple configuration by a properties file (install.cfg).