-
Notifications
You must be signed in to change notification settings - Fork 254
Remove SMB file sharing for Windows #4879
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
base: main
Are you sure you want to change the base?
Changes from all commits
573c4bc
4d0431d
61491c2
31f4ba7
f04c9fd
f330f89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,6 @@ | |
Name="Path" /> | ||
</Property> | ||
|
||
<Property Id="USERFOLDER"> | ||
<DirectorySearch Id="userProfileSearch" Depth="0" Path="[%USERPROFILE]" /> | ||
</Property> | ||
|
||
<Property Id="SHAREDDIRNAME" Secure="yes">crc-dir0</Property> | ||
|
||
<util:Group Id="CrcUsersGroup" Name="crc-users" /> | ||
<Directory Id="TARGETDIR" Name="SourceDir"> | ||
<Directory Id="ProgramFiles64Folder"> | ||
|
@@ -72,6 +66,11 @@ | |
<RegistryValue Type="string" Name="ElementName" Value="gvisor-tap-vsock" KeyPath="yes"/> | ||
</RegistryKey> | ||
</Component> | ||
<Component Id="Hvsock9pRegistryEntry" Guid="*"> | ||
<RegistryKey Root="HKLM" Key="Software\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices\00009000-FACB-11E6-BD58-64006A7986D3"> | ||
<RegistryValue Type="string" Name="ElementName" Value="fs9p-hvsock" KeyPath="yes"/> | ||
</RegistryKey> | ||
</Component> | ||
Comment on lines
+69
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Write 9P HVSOCK registry to 64‑bit hive (avoid WOW6432 redirection). Without marking the component as 64‑bit, the key may land under Wow6432Node and not be honored by Guest Communication Services. Apply this diff: - <Component Id="Hvsock9pRegistryEntry" Guid="*">
+ <Component Id="Hvsock9pRegistryEntry" Guid="*" Win64="yes">
<RegistryKey Root="HKLM" Key="Software\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices\00009000-FACB-11E6-BD58-64006A7986D3">
<RegistryValue Type="string" Name="ElementName" Value="fs9p-hvsock" KeyPath="yes"/>
</RegistryKey>
</Component> Optional (recommended): also mark VsockRegistryEntry as Win64 for consistency: - <Component Id="VsockRegistryEntry" Guid="*">
+ <Component Id="VsockRegistryEntry" Guid="*" Win64="yes"> 🤖 Prompt for AI Agents
|
||
</Directory> | ||
</Directory> | ||
</Directory> | ||
|
@@ -92,24 +91,6 @@ | |
Before="AddUserToHypervAdminGroup" | ||
Sequence="execute"/> | ||
<CustomAction Id="AddUserToHypervAdminGroup" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" /> | ||
<SetProperty Action="CACreateSMBShare" | ||
Id="CreateSMBShare" | ||
Value=""[POWERSHELLEXE]" -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command "New-SmbShare -Name '[SHAREDDIRNAME]' -Path '[USERFOLDER]' -FullAccess '[LogonUser]'"" | ||
Before="CreateSMBShare" | ||
Sequence="execute"/> | ||
<CustomAction Id="CreateSMBShare" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" /> | ||
<SetProperty Action="CAEnableFileAndPrinterSharing" | ||
Id="EnableFileAndPrinterSharing" | ||
Value=""[POWERSHELLEXE]" -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command "Set-NetFirewallRule -Group '@FirewallAPI.dll,-28502' -Enabled True -Profile 'Private,Public'"" | ||
Before="EnableFileAndPrinterSharing" | ||
Sequence="execute"/> | ||
<CustomAction Id="EnableFileAndPrinterSharing" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" /> | ||
<SetProperty Action="CARemoveSMBShare" | ||
Id="RemoveSMBShare" | ||
Value=""[POWERSHELLEXE]" -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command "Remove-SmbShare -Name '[SHAREDDIRNAME]' -Force"" | ||
Before="RemoveSMBShare" | ||
Sequence="execute"/> | ||
<CustomAction Id="RemoveSMBShare" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Impersonate="no" Return="ignore" /> | ||
|
||
<InstallExecuteSequence> | ||
<Custom Action="CreateCrcGroup" Before="ConfigureUsers"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom> | ||
|
@@ -118,9 +99,6 @@ | |
<Custom Action="InstallHyperv" Before="CreateCrcGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom> | ||
<Custom Action="RemoveCrcGroupRollback" After="CreateCrcGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom> | ||
<Custom Action="RemoveCrcDaemonTask" Before='RemoveFiles'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom> | ||
<Custom Action="EnableFileAndPrinterSharing" After="AddUserToHypervAdminGroup"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</Custom> | ||
<Custom Action="CreateSMBShare" After="EnableFileAndPrinterSharing"> NOT Installed AND NOT REMOVE~="ALL"</Custom> | ||
<Custom Action="RemoveSMBShare" After='RemoveCrcDaemonTask'>Installed AND NOT UPGRADINGPRODUCTCODE</Custom> | ||
<ScheduleReboot After="InstallFinalize"> NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED</ScheduleReboot> | ||
</InstallExecuteSequence> | ||
<Feature Id="DefaultFeature" Title="Install core features" Absent="disallow" Level="1"> | ||
|
@@ -130,6 +108,7 @@ | |
<ComponentRef Id="AddToPath"/> | ||
<ComponentRef Id="AddUserToCrcUsers" /> | ||
<ComponentRef Id="VsockRegistryEntry" /> | ||
<ComponentRef Id="Hvsock9pRegistryEntry" /> | ||
</Feature> | ||
<UI> | ||
<UIRef Id="WixUI_ErrorProgressText"/> | ||
|
@@ -140,9 +119,6 @@ | |
<ProgressText Action="InstallHyperv">Installing Hyper-V</ProgressText> | ||
<ProgressText Action="AddUserToHypervAdminGroup">Adding user: [LogonUser] to Hyper-V Administrators group</ProgressText> | ||
<ProgressText Action="RemoveCrcDaemonTask">Removing crcDaemon task</ProgressText> | ||
<ProgressText Action="CreateSMBShare">Creating share named: [SHAREDDIRNAME] for folder: [USERFOLDER]</ProgressText> | ||
<ProgressText Action="RemoveSMBShare">Removing share named: [SHAREDDIRNAME] for folder: [USERFOLDER]</ProgressText> | ||
<ProgressText Action="EnableFileAndPrinterSharing">Enabling file and printer Sharing</ProgressText> | ||
</UI> | ||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> | ||
<!-- this should help to propagate env var changes --> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Add p9 dependency: OK. Please double-check any lingering SMB/CIFS references.
The module addition aligns with the move to 9P. As a precaution for this PR’s objective (remove SMB on Windows), scan the tree for any remaining SMB/CIFS usage or password plumbing.
Run this script to verify no SMB/CIFS remnants remain and that 9p is wired on Windows:
🏁 Script executed:
Length of output: 820
Add p9 dependency: OK — remove leftover SMB/CIFS credential plumbing
9p is wired on Windows, but the repo still contains SharedDir credential fields/uses; these need to be removed or refactored.
Files to fix:
Action: remove or replace SMB/CIFS credential plumbing (structs, config, callers, and settings) or explicitly document why they must remain. Re-run the search after changes to confirm no SMB/CIFS remnants remain.
🤖 Prompt for AI Agents