Skip to content
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

Example CLM support #786

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

timbrigham-oc
Copy link

Proposed Changes

This is an example that changes how PowerShell is launched during the installation process.
Proof of concept to demonstrate it remediates the issue with Constrained Language Mode. Also includes a build script for running wix.

Not really viable for everyone since it hard codes the expected paths to the defaults on the C: drive.

Related Issues

#783

@FaserF
Copy link
Contributor

FaserF commented Dec 5, 2024

I dont think hard coding the install dir makes sense, as this would remove the choice for users / company admins to install the App to a different folder. Me for myself wont need that feature, but I can understand the need for company admins to change the dir

@timbrigham-oc
Copy link
Author

@FaserF this is proof of concept, definitely not ready for an immediate merge.
I was hoping someone with more WIX background then I could improve on it.

The most important thing is stops the code in the custom actions from being dot sourced (and therefore failing) in devices that run PowerShell CLM. I'm sure the same thing could be done by removing the -File argument in the line I mentioned, and either prepending the space with the backtick to escape spaces or using the old C:\PROGRA~1 aliases or similar. The problem is how the space is interpreted.

@timbrigham-oc timbrigham-oc marked this pull request as draft December 5, 2024 14:13
@timbrigham-oc
Copy link
Author

The same issue also exists for the the CA_PowerShell_Uninstall statement. It didn't cause the uninstall to fail, but it doesn't remove the tasks. I've included that example here as well.

@timbrigham-oc timbrigham-oc marked this pull request as ready for review January 2, 2025 19:30
@timbrigham-oc
Copy link
Author

This behavior can also be corrected by wrapping the statement into a -Command argument with a script block instead of using -File and making the call explicit. I tried this method and was able to successfully install to arbitrary locations while still having CLM mode active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants