@@ -11,6 +11,7 @@ import (
1111"ue-git-plugin-manager/internal/engine" 
1212"ue-git-plugin-manager/internal/git" 
1313"ue-git-plugin-manager/internal/plugin" 
14+ "ue-git-plugin-manager/internal/projectconfig" 
1415"ue-git-plugin-manager/internal/utils" 
1516
1617"github.com/fatih/color" 
@@ -64,6 +65,13 @@ func Run(app Application) error {
6465utils .Pause ()
6566}
6667app .GetUtils ().ClearScreen ()
68+ case  "Configure project" :
69+ app .GetUtils ().ClearScreen ()
70+ if  err  :=  runProjectConfigurator (app ); err  !=  nil  {
71+ fmt .Printf ("Error configuring project: %v\n " , err )
72+ utils .Pause ()
73+ }
74+ app .GetUtils ().ClearScreen ()
6775case  "Settings" :
6876app .GetUtils ().ClearScreen ()
6977if  err  :=  runSettings (app , config ); err  !=  nil  {
@@ -95,6 +103,7 @@ func showMainMenu(app Application, config *config.Config) (string, error) {
95103items  :=  []string {
96104"What is this?" ,
97105"Edit Setup" ,
106+ "Configure project" ,
98107"Settings" ,
99108"Quit" ,
100109}
@@ -250,7 +259,7 @@ func runUpdate(app Application, config *config.Config) error {
250259}
251260fmt .Printf ("✅ Done\n " )
252261
253- // Rebuild binaries for this engine  
262+ // Ensure stock plugin is disabled before rebuild  
254263// Find engine path for this version 
255264var  enginePath  string 
256265for  _ , e  :=  range  config .Engines  {
@@ -259,6 +268,14 @@ func runUpdate(app Application, config *config.Config) error {
259268break 
260269}
261270}
271+ if  app .GetEngine ().CheckPluginCollision (enginePath ) {
272+ if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
273+ fmt .Printf ("❌ %v\n " , err )
274+ continue 
275+ }
276+ }
277+ 
278+ // Rebuild binaries for this engine 
262279wt  :=  app .GetGit ().GetWorktreePath (update .EngineVersion )
263280fmt .Printf ("Compiling plugin for UE %s... " , update .EngineVersion )
264281if  err  :=  app .GetPlugin ().BuildForEngine (enginePath , wt ); err  !=  nil  {
@@ -773,16 +790,18 @@ func runSetupForEngine(app Application, config *config.Config, enginePath, engin
773790return  fmt .Errorf ("failed to create junction: %v" , err )
774791}
775792
793+ // Always disable stock plugin before building to avoid name collision 
794+ if  app .GetEngine ().CheckPluginCollision (enginePath ) {
795+ if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
796+ return  fmt .Errorf ("failed to disable stock plugin: %v" , err )
797+ }
798+ }
799+ 
776800// Build plugin 
777801if  err  :=  app .GetPlugin ().BuildForEngine (enginePath , worktreePath ); err  !=  nil  {
778802return  fmt .Errorf ("failed to build plugin: %v" , err )
779803}
780804
781- // Disable stock plugin 
782- if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
783- return  fmt .Errorf ("failed to disable stock plugin: %v" , err )
784- }
785- 
786805fmt .Printf ("✅ UE %s setup complete!\n " , engineVersion )
787806utils .Pause ()
788807return  nil 
@@ -817,6 +836,13 @@ func runUpdateForEngine(app Application, config *config.Config, enginePath, engi
817836return  fmt .Errorf ("failed to update worktree: %v" , err )
818837}
819838
839+ // Ensure stock plugin is disabled before rebuilding 
840+ if  app .GetEngine ().CheckPluginCollision (enginePath ) {
841+ if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
842+ return  fmt .Errorf ("failed to disable stock plugin: %v" , err )
843+ }
844+ }
845+ 
820846// Rebuild plugin 
821847fmt .Println ("Rebuilding plugin..." )
822848worktreePath  :=  app .GetGit ().GetWorktreePath (engineVersion )
@@ -855,20 +881,21 @@ func runRepairForEngine(app Application, config *config.Config, enginePath, engi
855881}
856882}
857883
884+ // Ensure stock plugin is disabled before any rebuild 
885+ if  app .GetEngine ().CheckPluginCollision (enginePath ) {
886+ if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
887+ return  fmt .Errorf ("failed to disable stock plugin: %v" , err )
888+ }
889+ }
890+ 
858891// Rebuild plugin if binaries missing 
859892if  ! status .BinariesExist  {
860893worktreePath  :=  app .GetGit ().GetWorktreePath (engineVersion )
861894if  err  :=  app .GetPlugin ().BuildForEngine (enginePath , worktreePath ); err  !=  nil  {
862895return  fmt .Errorf ("failed to build plugin: %v" , err )
863896}
864897}
865- 
866- // Disable stock plugin if still enabled 
867- if  status .StockPluginStatus  ==  "enabled"  {
868- if  err  :=  app .GetEngine ().DisableStockPlugin (enginePath ); err  !=  nil  {
869- return  fmt .Errorf ("failed to disable stock plugin: %v" , err )
870- }
871- }
898+ // Stock plugin already ensured disabled above 
872899
873900fmt .Printf ("✅ UE %s repaired successfully!\n " , engineVersion )
874901utils .Pause ()
@@ -1364,6 +1391,15 @@ func rebuildPluginForEngine(app Application, config *config.Config) {
13641391fmt .Printf (" Engine path: %s\n " , selectedEngine .EnginePath )
13651392fmt .Printf (" Worktree path: %s\n " , worktreePath )
13661393
1394+ // Ensure stock plugin is disabled before manual rebuild 
1395+ if  app .GetEngine ().CheckPluginCollision (selectedEngine .EnginePath ) {
1396+ if  err  :=  app .GetEngine ().DisableStockPlugin (selectedEngine .EnginePath ); err  !=  nil  {
1397+ fmt .Printf ("❌ Failed to disable stock plugin: %v\n " , err )
1398+ utils .Pause ()
1399+ return 
1400+ }
1401+ }
1402+ 
13671403if  err  :=  app .GetPlugin ().BuildForEngine (selectedEngine .EnginePath , worktreePath ); err  !=  nil  {
13681404fmt .Printf ("❌ Failed to rebuild plugin: %v\n " , err )
13691405} else  {
@@ -1372,3 +1408,8 @@ func rebuildPluginForEngine(app Application, config *config.Config) {
13721408
13731409utils .Pause ()
13741410}
1411+ 
1412+ // runProjectConfigurator starts the Configure project wizard 
1413+ func  runProjectConfigurator (app  Application ) error  {
1414+ return  projectconfig .RunWizard ()
1415+ }
0 commit comments