Comments (12)
Iโm open to pull requests to address this but with the bulk of boxstarter features and other projects I am involved with, I donโt really have cycles to tackle this.
from boxstarter.
@mwrock How much trouble is it to skip the custom text mentioned above and just display the origin
or the referer
?
Is it possible that when we click from a website, it is shown without the custom text?
E.g.
Boxstarter Version x
(c) Matt Wrock. http://boxstarter.orgRunning from http://WindowsRemix.com
Normal boxstarter output here
from boxstarter.
@mwrock Can you provide a link to the file where the command prompt output is output?
from boxstarter.
@Redsandro for the part that you have listed above, that would come under here:
Gary
from boxstarter.
One thing to keep in mind is that once the code has reached the powershell modules, the http context of the initial boxstarter.org request is gone. Here is a rough flow of how the "click-once" installs work:
- browser makes web request to boxstarter.org
- the "click-once" endpoint uses a deployment manifest to send back all the boxstarter bits to the client
- The click-once client code unpackages those bits and finally invokes the boxstarter.clickonce C# dll
- that dll invokes the boxstarter powershell which kicks off the boxstarter run
Everything prior to calling the boxstarter.clickonce dll is part of proprietary "click-once" goo where boxstarter doesn't actively do anything. The dll I refer to really acts as a packaging conduit for all the boxstarter powershell and a single C# file: launcher.cs.
see https://github.com/mwrock/boxstarter/blob/master/Boxstarter.ClickOnce/Launcher.cs
That is the file that interacts with some click-once API stuff and builds out the call to boxstarter telling it which package it is going to need to install. Here is where you would be able to get the referrer and you would need to pass that on to the boxstarter call.
I'm not sure what the call is to get the referrer but there must be one (at least I would assume) and it should be fairly easy to look up.
from boxstarter.
I'm not sure how your magic works, but I'm assuming you need to pass everything you want to use later on to boxstarter.bat
using psArgs
, no?
Would something like this work for that?
using System;
using System.Web;
using System.Web.Util;
HttpContext context = HttpContext.Current;
HttpRequest request = context != null ? context.Request : null;
HttpResponse response = context != null ? context.Response : null;
$remoteAddr = request.ServerVariables["REMOTE_ADDR"];
$referer = request.ServerVariables["HTTP_REFERER"];
// if $remoteAddr != null
psArgs += " -remoteAddr = $remoteAddr"
// if $referer != null
psArgs += " -referer = $referer"
// Process.Start(processInfo);
I'm pretending to know this language a lot better than I actually do. I thought using this as a reference would make this more credible: https://github.com/Microsoft/referencesource/blob/master/System.Web/UI/ViewStateException.cs
from boxstarter.
Hmmm. I dont think that will work. Inside launcher.cs, there is no HttpContext
. Keep in mind this is executing on the client. The click-once API simply packages some of the relevant values of the HttpContext it had on the server and makes it available in the ApplicationDeployment
object. I think you will need to do some googling on ApplicationDeployment
to see what properties it exposes.
from boxstarter.
I can't find what I am hoping to find. But another possibility seems to be adding an identifier/label/referer in the clickOnce querystring:
private NameValueCollection GetQueryStringParameters()
{
NameValueCollection nameValueTable = new NameValueCollection();
if (ApplicationDeployment.IsNetworkDeployed)
{
string queryString = ApplicationDeployment.CurrentDeployment.ActivationUri.Query;
nameValueTable = HttpUtility.ParseQueryString(queryString);
}
return (nameValueTable);
}
as found in the answer to this question:
https://stackoverflow.com/questions/9734704/net-clickonce-application-can-resolve-de-url-or-domain-of-the-page-from-it-was
We could probably append ?referer=some+label+or+url+here
to the url if this is acceptable and not conflicting with the rest of the workings of Boxstarter.
from boxstarter.
Yeah that would work. Also I did a check on the information available via the ApplicationDeployment
object and there is no referrer information so this is likely the only feasible approach.
You would need to edit the url rewrite rules in https://github.com/mwrock/boxstarter/blob/master/Web/Web.config to make sure the referrer gits put in the rewritten url.
from boxstarter.
Hmm.. let's see. Your usage of querystring is not according to standards, making this a little harder. Basically you use a variablename as a value when providing the url, leaving no room to add other variables.
However, looking at this, I think we might be able to pass in the referer after all, ignoring the querystring. Although I'm not sure. You use QUERY_STRING
here, which is a variable from the request. Doesn't that mean you can use HTTP_REFERER
here too?
That would mean in every <action/>
for url
you would simply append &referer={HTTP_REFERER}
, and we're one step closer.
If this works, this would be the easier solution. And it's always nice to use the actual referer.
Typo of the week:
You can sue this information to make rewriting decisions
http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference
from boxstarter.
Yeah its been a long while since touching this code. And my suit is still stuck in legal red tape :)
from boxstarter.
I've been looking around a few times, but this construct/language is really complex for me.
I still hear this "I look like I'm being hacked" when people use WindowsRemix sometimes, mostly because there is no 'branding'. I'd love for you to find a way to implement a string parameter one can optionally pass to Boxstarter that it prints.
I could say "Windows Remix is applying the requested operations."
Possibly even add an origin in your code: "Script launched from: ". This has the added benefit of identifying the source if the script was actually launched from a fishy source. If that ever happens.
from boxstarter.
Related Issues (20)
- PRs (etc) no longer have build logs available
- enable Boxstarter modules to be loaded on Linux systems
- Boxstarter gets installed to top of PSModulePath and overwrites Write-Host HOT 5
- Strange Behavior with PROCESSOR_ARCHITECTURE environment variable HOT 6
- Set-BoxstarterTaskbarOptions - Disable News and Interests Icon
- Bootstrapper is failing with Chocolatey v2.0.0 HOT 2
- Certain Chocolatey commands, such as `choco list`, do not work as intended as parameters are not passed correctly HOT 1
- Boxstarter (weblauncher) always installs latest version of Chocolatey HOT 5
- Boxstarter 3.0.2 install error HOT 3
- Bootstrapping Boxstarter fails due to Chocolatey directory already existing HOT 1
- Allow usage of the chocolatey.org/install.ps1 to be overridden HOT 7
- Deploy Chocolatey 2.3 with Boxstarter
- Optional feature to show/log the reason for rebooting
- Boxstarter fails when chocolatey-community-validation.Extension is installed HOT 1
- Merge individual function scripts into a PowerShell module file HOT 4
- Install-BoxstarterPackage: Errors Array of result object is empty, even if an error occurs HOT 2
- Enable GitHub security and static analysis scanning
- Boxstarter.Winconfig\Install-WindowsUpdate errors out with 0x8002802B (TYPE_E_ELEMENTNOTFOUND) HOT 1
- Package parameter does not work: /nodesktopicon
- Lots of verbose output noise when installing Chocolatey packages using Boxstarter 3.0.3.0 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxstarter.