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

Use LocalUser/LocalGroup which is created in CreateFolders #38

Open
yusukemasuda opened this issue Dec 7, 2023 · 3 comments
Open

Use LocalUser/LocalGroup which is created in CreateFolders #38

yusukemasuda opened this issue Dec 7, 2023 · 3 comments

Comments

@yusukemasuda
Copy link

I want to set user or group which is created by UserPrivileges extension, to Directory permission.

<Component Id="CreateLocalUserGroups" Guid="...." Transitive="no" Win64="yes" KeyPath="yes">
        <!-- Create "Olympus Service" Group -->
	<UserPrivileges:LocalGroup Id="MyGroup" Name="MyGroup" Description="This is MyGroup"
			CheckIfExists="yes" CreateOnInstall="yes" DeleteOnUnInstall="no"/>
</Component>
<Component Id="...." Guid="...." Transitive="yes">
    <CreateFolder Directory="....">
         <Permission User="MyGroup" GenericAll="yes" />
    </CreateFolder>
    <RemoveFolder Id="...." On="uninstall" Directory="....." />
</Component>

The directory is created in immediate sequence, however the LocalUser/LocalGroup is created in defferred sequence, so the directory creation would fail.

Do you have any option to create LocalUser/LocalGroup in immediate sequence?

@dblock
Copy link
Owner

dblock commented Dec 8, 2023

You can probably just reorder the sequence of actions in your MSI, but eventually you have impossible situations of such dependencies. Either way the feature request to allow this makes sense. Not sure how best to fix this, but PRs welcome! Probably a different component that applies the group to a directory and creates it if it doesn't exist is the way to go.

@yusukemasuda
Copy link
Author

yusukemasuda commented Dec 12, 2023

@dblock Sorry for the delay.
Currently, the sequence of LocalUser/LocalGroup creating is separated in 2 steps 'immediate' and 'defferred'.
I am not familiar to Wix extensions though, why don't you combine them and go it on 'immediate' sequence.
The 'CreateFolders' sequence is executed in 'immediate'. If the user/group is created in 'immediate', we can arrange execution order in .
The problem for me is unable to arrange the sequence order between 'immediate' and 'defferred'.

@dblock
Copy link
Owner

dblock commented Dec 12, 2023

Well, you can't do that, that's by design. Read about the whole deferred business here. Basically the immediate sequence is only used to decide what to do, and the deferred one is to do it. It's a way to do transactional installs, one of the most powerful features in MSI. It enables running installations with different permissions in the immediate sequence, installations without UX, and supports rollback.

I think you're incorrect that the create folder action is executed in immediate. It may be "planned" in the immediate one, but it's actually executed in deferred. Check the detailed log for the order of events, and paste the relevant parts here, and I'll try to help?

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

No branches or pull requests

2 participants