Unable to create wayk agent custom executable

avatar

Hi, Whenever I tried to create a custom executable, it thorws me an error.

"wayk_cse_patcher] Wayk CSE patcher failed: Failed to download MSI for x64 architecture"

The file is still being generated, I have not execute it to test before, but i suspect that it did not capture the config I set, in the New-WaykCustomExecutable.

forum image

Thanks.

All Comments (8)

avatar

Hello

Sorry for the inconvenience.

I looked into the issue, and there's a bug in the patcher itself (actually - the URL it is calling to retrieve the latest installer version is out-of-date). I'll enter an issue on Github and see that this is fixed, and write back here with an update.

In the meantime; have you tried to generate the executable without embedding the installer?

-EmbedMsi = $false

Generally, most people would prefer this - the end user will always get the latest Agent version (instead of having to recreate your custom .exe to track new versions of the Agent) and the final package will be a lot smaller. The downside is that the final user must have the bandwidth to download the ~20MB installer themselves.

If you prefer to embed the MSI, and can't wait for a fix, there is a potential workaround where you can download the installer manual and specify that to the patcher using an environment variable. Let me know if that's something you'd like to try.

Thanks and kind regards,

Richard Markievicz

avatar

Hi Richard,

Thanks. Thanks for the quick guide. Am able to compile the agent from there. The reason for embedding the msi, so there is a standard version across the board for all devices, let me know how we can specify with the environment variable.

Thanks.

avatar

Hello

Sorry for the delay. We've been working to resolve the issue with the packer and PowerShell module. Unfortunately, we recently merged changes that have introduced a non-trivial build issue. You can look for a fix in the coming days, and I'll post back in this thread once that's available.

In the meantime, you should be able to progress like this:

  • Download the installer(s) that you wish to package, and place them in a local directory
  • For reference, the latest Agent installers are:


https://cdn.devolutions.net/download/Wayk/2021.1.3.0/WaykAgent-x86-2021.1.3.0.msi
https://cdn.devolutions.net/download/Wayk/2021.1.3.0/WaykAgent-x64-2021.1.3.0.msi 

  • You need to rename the installers like this: "WaykNow_{bitness}.msi". So, for example, you might have "WaykNow_x64.msi" and/or "WaykNow_x86.msi". Note the name WaykNow and the underscore separating the name from the bitness
  • Set the environment variable "CSE_LOCAL_ARTIFACTS" to the directory containing your installers. For example:


$Env:CSE_LOCAL_ARTIFACTS = "c:\installers"

Now try your packaging again. The packer will search the directory specified in CSE_LOCAL_ARTIFACTS for files matching the pattern "WaykNow_{bitness}.msi" and use it instead of trying the on-the-fly download.

Please let me know if you some questions or comments. I apologize for the inconvenience.

Thanks and kind regards,

Richard Markievicz

avatar

thanks! have tested it, it is working.

Wanted to understand more on the parameters when i am running the command. Is there anymore commands apart from the below? I tried to use the command from the waykagent msi building page - INSTALLDESKTOPSHORTCUT "" ` but to no avail.

New-WaykCustomExecutable `
-DenUrl "https://bastion.contoso.com" `
-TokenId "8ffc6813-af85-440a-aae5-b8a23c3084c3" `
-BrandingFile ".\branding.zip" `
-DestinationPath ".\output" `
-DestinationName "MyCustomExecutable" `
-Architecture "x64" `
-EmbedMsi $true `
-Quiet $true `
-AutoUpdateEnabled $true `
-AutoLaunchOnUserLogon $true `
-ShowMainWindowOnLaunch $true `
-Language 'en'

Another question I have is, lets say we install this agent into users and we would like to disable users with local admin rights, the ability not to uninstall the agent. Is there a way to stop them from doing so?

Thanks for the response and support.

avatar

Hello,

Here are all the different parameters that are accepted, with the default values shown after the = sign:

-DenUrl
-TokenId
-BrandingFile
-DestinationPath
-DestinationName = "CustomWayk"
-Architecture = "x64"
-StartAfterInstall = $true
-EmbedMsi = $false
-Quiet = $false
-AnalyticsEnabled = $true
-AutoUpdateEnabled = $true
-CrashReporterAutoUpload = $true
-CrashReporterEnabled = $true
-AutoLaunchOnUserLogon = $false
-MinimizeToNotificationArea = $false
-ShowMainWindowOnLaunch = $true
-FriendlyName
-Language
-AllowNoPassword = $true
-AllowPersonalPassword = $true
-AllowSystemAuth = $true
-GeneratedPasswordAutoReset = $true
-GeneratedPasswordCharSet
-GeneratedPasswordLength


Unfortunately, INSTALLDESKTOPSHORTCUT is not supported.

If the user has admin rights, there is no way to prevent the uninstallation of the Wayk Agent. You can remove the option to uninstall an application from the Start menu using a Group Policy, but it would affect all your applications.

Best regards,

Richard Boisvert

avatar

thanks for sharing. will test it out then.

avatar

Hello autoscion

Thank you for your patience with this. I'm happy to let you know we're releasing version 2021.1.4 of the PowerShell module that corrects the original issue you experienced. That should be available on PSGallery soon so please check for updates.

The delay was caused by some build and packaging issues on our end - we've ported the patcher to Linux so it can run on the Wayk Bastion backend. In the future, it will be possible to generate the CSE from within the Wayk Bastion web UI instead of needed to use the patcher or PowerShell module manually.

Further, I added parameters to disable the start menu and desktop shortcuts. These options were already present in the patcher but omitted from the PowerShell module.

`-CreateDesktopShortcut $false -CreateStartMenuShortcut $false`

To reiterate what my colleague already wrote; it seems like a losing battle to try and prevent a local administrator from being able to uninstall programs. It might be possible by playing with the permissions in the uninstall registry key (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall) but a determined administrator will surely find a way around that.

Please don't hesitate to post back if you have further questions or issues.

Thanks and kind regards,

Richard Markievicz

avatar

Hello again

Version 2021.1.4 of the PowerShell module is now up on PSGallery.

Thanks and kind regards,

Richard Markievicz