| 207 | } |
| 208 | |
| 209 | void BoxedContainer::findApps(std::vector<BoxedApp>& apps) { |
| 210 | std::set<BString> wineApps; |
| 211 | |
| 212 | wineApps.insert(B("taskmgr.exe")); |
| 213 | wineApps.insert(B("winecfg.exe")); |
| 214 | wineApps.insert(B("clock.exe")); |
| 215 | //wineApps.insert("winefile.exe"); |
| 216 | wineApps.insert(B("winemine.exe")); |
| 217 | //wineApps.insert("cmd.exe"); |
| 218 | wineApps.insert(B("explorer.exe")); |
| 219 | wineApps.insert(B("iexplore.exe")); |
| 220 | //wineApps.insert("hh.exe"); |
| 221 | wineApps.insert(B("notepad.exe")); |
| 222 | wineApps.insert(B("regedit.exe")); |
| 223 | wineApps.insert(B("wordpad.exe")); |
| 224 | //wineApps.insert("wmplayer.exe"); |
| 225 | std::shared_ptr<FileSystemZip> fs = this->fileSystem.lock(); |
| 226 | if (fs && fs->hasWine()) { |
| 227 | FsZip::iterateFiles(fs->filePath, [this, &apps, &wineApps](BString fileName) { |
| 228 | if (!fileName.endsWith('/')) { |
| 229 | BString name = Fs::getFileNameFromPath(fileName); |
| 230 | BString lname = name.toLowerCase(); |
| 231 | |
| 232 | if (wineApps.count(lname)) { |
| 233 | bool found = false; |
| 234 | for (auto& a : apps) { |
| 235 | if (a.cmd == name) { |
| 236 | found = true; |
| 237 | break; |
| 238 | } |
| 239 | } |
| 240 | if (!found) { |
| 241 | BoxedApp app; |
| 242 | app.container = this; |
| 243 | app.name = name; |
| 244 | app.path = "/" + Fs::getParentPath(fileName); |
| 245 | app.cmd = app.name; |
| 246 | apps.push_back(app); |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | }); |
| 251 | BoxedApp app; |
| 252 | app.container = this; |
| 253 | app.name = B("wineboot -u"); |
| 254 | app.path = B("/bin"); |
| 255 | app.cmd = B("wineboot"); |
| 256 | app.args.push_back(B("-u")); |
| 257 | apps.push_back(app); |
| 258 | } |
| 259 | if (doesFileExist(B("/usr/local/bin/startx"))) { |
| 260 | BoxedApp app; |
| 261 | app.container = this; |
| 262 | app.name = B("startx"); |
| 263 | app.path = B("/usr/local/bin/"); |
| 264 | app.iconPath = GlobalSettings::getDemoFolder().stringByApppendingPath("startx.png"); |
| 265 | if (!Fs::doesNativePathExist(app.iconPath)) { |
| 266 | FsZip::extractFileFromZip(fs->filePath, B("icons/startx.png"), GlobalSettings::getDemoFolder()); |
no test coverage detected