seph
01/16/2020, 6:02 PMnyanshak
01/16/2020, 10:09 PMIf you’re trying to do this regularly, you should probably figure out packaging systems for real.Are there any docs on that anywhere? I'm just finding lots of old blogs from 2009 to 2012 talking about "orca", "super orca", "insted" but nothing that looks... reasonable for packaging this on an ongoing basis. And for the one-off version... I've decompiled it, edited the
package/wix
files to add what I need and edited osquery-<version>.wsx
to add those files, but I don't know what wix command to run to actually build them.PS C:\osquery\build> candle .\osquery-4.1.2.wxs
Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.
osquery-4.1.2.wxs
PS C:\osquery\build> light .\osquery-4.1.2.wixobj
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.
C:\osquery\build\osquery-4.1.2.wxs(119) : error LGHT0094 : Unresolved reference to symbol 'Property:WIX_ACCOUNT_ADMINISTRATORS' in section 'Product:{0F09414E-B63F-4378-B070-99BBE8A7FA44}'.
C:\osquery\build\osquery-4.1.2.wxs(120) : error LGHT0094 : Unresolved reference to symbol 'Property:WIX_ACCOUNT_LOCALSYSTEM' in section 'Product:{0F09414E-B63F-4378-B070-99BBE8A7FA44}'.
C:\osquery\build\osquery-4.1.2.wxs(121) : error LGHT0094 : Unresolved reference to symbol 'Property:WIX_ACCOUNT_USERS' in section 'Product:{0F09414E-B63F-4378-B070-99BBE8A7FA44}'.
C:\osquery\build\osquery-4.1.2.wxs(122) : error LGHT0094 : Unresolved reference to symbol 'WixUI:WixUI_InstallDir' in section 'Product:{0F09414E-B63F-4378-B070-99BBE8A7FA44}'.
PS C:\osquery\build>
zwass
01/16/2020, 10:44 PMmake_windows_package.ps1
, modifying to suit my needs, and building with candle and light. Possibly you just need to add some PropertyRef
elements or something to make that one work?nyanshak
01/16/2020, 11:04 PMzwass
01/16/2020, 11:23 PMnyanshak
01/16/2020, 11:24 PMPS C:\osquery> .\tools\deployment\make_windows_package.ps1
[-] Did not find build directory at C:\osquery\tools\deployment\..\..\buck-out\release\gen\osquery. Check build script output.
@zwass that's what I'm getting when I try to run itzwass
01/16/2020, 11:24 PMseph
01/17/2020, 3:20 AMnyanshak
01/17/2020, 5:02 PMcustom
directory with my flag file and enrollment secret, then adding this patch:
diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake
index 73bc1b6a..9e83f888 100644
--- a/cmake/packaging.cmake
+++ b/cmake/packaging.cmake
@@ -209,9 +209,12 @@ function(generateInstallTargets)
file(COPY "${CMAKE_SOURCE_DIR}/tools/provision/chocolatey/osquery_utils.ps1" DESTINATION "${CMAKE_BINARY_DIR}/package/wix")
install(FILES "${CMAKE_BINARY_DIR}/package/wix/osquery_utils.ps1" DESTINATION .)
- file(WRITE "${CMAKE_BINARY_DIR}/package/wix/osquery.flags")
+ file(COPY "${CMAKE_SOURCE_DIR}/custom/osquery.flags" DESTINATION "${CMAKE_BINARY_DIR}/package/wix")
install(FILES "${CMAKE_BINARY_DIR}/package/wix/osquery.flags" DESTINATION .)
+ file(COPY "${CMAKE_SOURCE_DIR}/custom/kolide.enrollment_secret" DESTINATION "${CMAKE_BINARY_DIR}/package/wix")
+ install(FILES "${CMAKE_BINARY_DIR}/package/wix/kolide.enrollment_secret" DESTINATION .)
+
# osqueryd
install(TARGETS osqueryd DESTINATION osqueryd)
diff --git a/cmake/wix_patches/osquery_wix_patch.xml b/cmake/wix_patches/osquery_wix_patch.xml
index bfb25032..41613f89 100644
--- a/cmake/wix_patches/osquery_wix_patch.xml
+++ b/cmake/wix_patches/osquery_wix_patch.xml
@@ -11,7 +11,7 @@
<ServiceInstall Id='osqueryd'
Name='osqueryd'
Account='NT AUTHORITY\SYSTEM'
- Arguments='--flagfile="[INSTALL_ROOT]osquery.flags"'
+ Arguments='--flagfile="[INSTALL_ROOT]osquery.flags" --enroll_secret_path="[INSTALL_ROOT]kolide.enrollment_secret"'
Start='auto'
Type='ownProcess'
Vital='yes'
@@ -28,4 +28,4 @@
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />
</CPackWiXFragment>
-</CPackWiXPatch>
\ No newline at end of file
+</CPackWiXPatch>
zwass
02/04/2020, 2:50 AM.wxs
file.seph
02/04/2020, 2:56 AMossltool
for code signingzwass
02/04/2020, 4:31 PMossltool
is next up on the list.seph
02/04/2020, 5:08 PM