Title
#kolide
w

wkleinhenz

04/13/2020, 8:21 PM
hello, im attempting tro build a windows msi for launcher and am having issues with the launcher and osquery version flag, ideally i need to be able to specify either a local path or a different ip
sundsta

sundsta

04/13/2020, 9:14 PM
You configure what server it connects to with the
hostname
flag
w

wkleinhenz

04/13/2020, 9:21 PM
i thought hostname was to set the fleet server hostname not where to download the osquery/launcher stuff from
9:27 PM
im trying to do this
--osquery_version .\windows\osqueryd
9:29 PM
but it just puts the arg as part of the url for dl.kolide.co
s

seph

04/13/2020, 9:31 PM
By default, launcher uses kolide’s notary server and download server. Of you want to change those, you can look at:
-mirror_url                  The mirror server for autoupdates
  -notary_prefix               The prefix for Notary path that contains the collections
  -notary_url                  The Notary update server
9:31 PM
package-builder is pretty simple. Look at
package-builder make --help
9:32 PM
Or, if you’re disabling autoupdate, and just want to grab a local binary. you can set
update_channel
to a path on local disk.
w

wkleinhenz

04/13/2020, 9:33 PM
oh ok, ill have to try that but i think the help states that osquery_version can use a file path
9:34 PM
thats why im confused
s

seph

04/13/2020, 9:34 PM
Oh, yes, I wrote it down! If you specify a file path in
osquery_version
or
launcher_version
it should build that into the resultant binary. But you will probably still havbe the autoupdate stuff enabled.
9:35 PM
So… Are you trying to use package-builder to build soemthing without autoupdate, or are you trying to use your own update server?
w

wkleinhenz

04/13/2020, 9:37 PM
so for the time being i was trying to build an msi without autoupdate for testing, hence wanting to pull from a filepath, ideally it would pull from our artifactory server
s

seph

04/13/2020, 9:38 PM
Initial package build time isn’t the same as runtime update sources.
w

wkleinhenz

04/13/2020, 9:39 PM
so are those not for the inital building of an msi?
s

seph

04/13/2020, 9:40 PM
Skimming things:1. If you set
update_channel
to empty string, which might be the default, it will disable the runtime update functionality. 2. package build time uses the
_version
options. And either they specify the download channel, or a FS path.
w

wkleinhenz

04/13/2020, 9:42 PM
so itll use the _version to intially populate the msi?
s

seph

04/13/2020, 9:42 PM
Yes, pretty sure.
9:43 PM
If you find bugs in the MSI, I certainly want to hear about them.
w

wkleinhenz

04/13/2020, 9:43 PM
cause my issue is that when i specify
osquery_version
with a filepath, not sure about the others, it takes the value and puts it as part of the url for the normal download
s

seph

04/13/2020, 9:44 PM
What are you doing, exactly?
w

wkleinhenz

04/13/2020, 9:44 PM
the goal or the commands?
s

seph

04/13/2020, 9:44 PM
The command line
w

wkleinhenz

04/13/2020, 9:45 PM
uh well i can give an approx, cant copy and paste but ill give it a shot one sec
s

seph

04/13/2020, 9:45 PM
You’re running this from a windows box? in a cmd.exe or powershell?
w

wkleinhenz

04/13/2020, 9:45 PM
cmd
s

seph

04/13/2020, 9:46 PM
Though… I bet I can guess. The underlying functionality here is https://github.com/kolide/launcher/blob/a8761d72ed848d13bd40d6ec40b88c1662ffe445/pkg/packaging/packaging.go#L301-L302 which looks for a string starting with
./
to decide if it’s local. That’s probaby never true in cmd.
9:46 PM
You could probably try powershell, and using
./
as the beginning of the path (or
/
), or you can make that logic more robust on windows.
w

wkleinhenz

04/13/2020, 9:47 PM
yeah i have paths like C:\Users\user\Desktop\windows\osqueryd
9:47 PM
but i can give it a shot with ps or relative pathing
s

seph

04/13/2020, 9:47 PM
Yeah. pretty sure that’s it then. The logic isn’t going to work there.
9:48 PM
That logic is clearly fragile (or really, targeting my use case). I’d review a PR for it. But I’m not sure I can get to writing one this week. Not sure if it’s better to check if the binary exists. Or what.
w

wkleinhenz

04/13/2020, 9:49 PM
yeah its weird in my mind a full path is usually better so thats why it threw me off i guess
w

wkleinhenz

04/13/2020, 9:54 PM
ok i think that got further, but i need to install wix\heat, thanks for the help
s

seph

04/13/2020, 9:54 PM
It expects wix on a fairly specific path.
w

wkleinhenz

04/13/2020, 9:55 PM
yeah i didnt realize i had to install it