@@ -108,30 +108,56 @@ ComponentProps MakeComponentProps(std::vector<std::filesystem::path> pathList)
108108
109109std::vector<std::pair<std::string, std::tuple<ComponentState, ComponentProps>>> uninstallComponents;
110110
111+ static std::filesystem::path GetMillenniumLocalPath ()
112+ {
113+ const char * localAppData = std::getenv (" LOCALAPPDATA" );
114+ if (localAppData) {
115+ return std::filesystem::path (localAppData) / " Millennium" ;
116+ }
117+ return {};
118+ }
119+
111120// clang-format off
112121void InitializeUninstaller ()
113122{
114123 steamPath = GetSteamPath ();
124+ auto millenniumLocalPath = GetMillenniumLocalPath ();
115125
116126 isUninstalling = false ;
117127 uninstallFinished = false ;
118128
129+ bool isNewLayout = !millenniumLocalPath.empty () && std::filesystem::exists (millenniumLocalPath);
130+
131+ std::vector<std::filesystem::path> millenniumPaths;
132+
133+ if (isNewLayout) {
134+ // New install (>2.35.0): files in %LOCALAPPDATA%/Millennium + hardlink in Steam
135+ millenniumPaths = {
136+ millenniumLocalPath / " lib" ,
137+ millenniumLocalPath / " bin" ,
138+ steamPath / " wsock32.dll" ,
139+ };
140+ } else {
141+ // Legacy install (<=2.35.0): files in Steam directory
142+ millenniumPaths = {
143+ steamPath / " user32.dll" ,
144+ steamPath / " version.dll" ,
145+ steamPath / " wsock32.dll" ,
146+ steamPath / " ext" / " compat32" / " millennium_x86.dll" ,
147+ steamPath / " ext" / " compat32" / " python311.dll" ,
148+ steamPath / " ext" / " compat64" / " millennium_x64.dll" ,
149+ steamPath / " ext" / " compat64" / " python311.dll" ,
150+ steamPath / " millennium.hhx64.dll" ,
151+ steamPath / " millennium.dll" ,
152+ steamPath / " python311.dll" ,
153+ };
154+ }
155+
119156 uninstallComponents = {
120- { " Millennium" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps ({
121- steamPath / " user32.dll" ,
122- steamPath / " version.dll" ,
123- steamPath / " wsock32.dll" ,
124- steamPath / " ext" / " compat32" / " millennium_x86.dll" ,
125- steamPath / " ext" / " compat32" / " python311.dll" ,
126- steamPath / " ext" / " compat64" / " millennium_x64.dll" ,
127- steamPath / " ext" / " compat64" / " python311.dll" ,
128- steamPath / " millennium.hhx64.dll" ,
129- steamPath / " millennium.dll" ,
130- steamPath / " python311.dll"
131- })) },
132- { " Custom Steam Components" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps ({
133- steamPath / " ext" / " data" / " assets" ,
134- steamPath / " ext" / " data" / " shims"
157+ { " Millennium" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps (millenniumPaths)) },
158+ { " Custom Steam Components" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps ({
159+ steamPath / " ext" / " data" / " assets" ,
160+ steamPath / " ext" / " data" / " shims"
135161 })) },
136162 { " Dependencies" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps ({ steamPath / " ext" / " data" / " cache" , steamPath / " ext" / " data" / " pyx64" })) },
137163 { " Themes" , std::make_tuple (ComponentState ({ false , true }), MakeComponentProps ({ steamPath / " steamui" / " skins" })) },
0 commit comments