In my version of MiKTeX Portable I am running into a problem that I thought I had fixed already. When the program is run it opens the MiKTeX tray icon which is not actually the process that is launched originally. Instead, it leaves a process running called "miktex-taskbar-icon.tmp". Until recently, I had no problems with it, so I assumed it was correctly handling this process. On the most recent Dev Test, I put in some configuration file moving which a user pointed out to me isn't working properly. I'll put the full launcher.ini file below to see what I'm doing wrong. Thanks to anyone who can help me figure this one out; I'd really hate to keep the config files in the App folder again.
[Launch] AppName=MiKTeX ProgramExecutable=MiKTeX\miktex\bin\miktex-taskbar-icon.exe SinglePortableAppInstance=true SingleAppInstance=true CloseEXE=miktex-taskbar-icon.tmp SplashTime=0 WaitForProgram=true WaitForEXE1=miktex-taskbar-icon.tmp HideCommandLineWindow=true DirectoryMoveOK=true [Activate] Registry=true [RegistryKeys] texassoc=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tex [RegistryCleanupIfEmpty] 1=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tex [RegistryValueBackupDelete] 1=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tex\ [QtKeysCleanup] 1=Qt Plugin Cache 4.7.false\%PAL:Drive%\ [DirectoriesMove] dvipdfm_config=%PAL:AppDir%\MiKTeX\dvipdfm\config dvips_config=%PAL:AppDir%\MiKTeX\dvips\config fontconfig=%PAL:AppDir%\MiKTeX\fontconfig metafont_config=%PAL:AppDir%\MiKTeX\metafont\config metapost_config=%PAL:AppDir%\MiKTeX\metapost\config miktex_config=%PAL:AppDir%\MiKTeX\miktex\config pdftex_config=%PAL:AppDir%\MiKTeX\pdftex\config tex_generic_config=%PAL:AppDir%\MiKTeX\tex\generic\config tex_generic_xetexconfig=%PAL:AppDir%\MiKTeX\tex\generic\xetexconfig tex_latex_config=%PAL:AppDir%\MiKTeX\tex\latex\config tex_latex_latexconfig=%PAL:AppDir%\MiKTeX\tex\latex\latexconfig tex_plain_config=%PAL:AppDir%\MiKTeX\tex\plain\config tex_texinfo_config=%PAL:AppDir%\MiKTeX\tex\texinfo\config tex_xelatex_xetexconfig=%PAL:AppDir%\MiKTeX\tex\xelatex\xetexconfig texworks_config=%PAL:AppDir%\MiKTeX\TeXworks\0.4\configuration tug_config=%PAL:AppDir%\MiKTeX\TUG
Offhand, I'd guess that it's because that file isn't an exe. You can likely handle it with custom code.
Also, you can delete the waitforprogram line, since you have it set to default.
Additionally, since this is a dev test, you should have the splash screen show up briefly, rather than disabled.
Finally, with the exception of the Qt key, the registry stuff will be able to be removed once file association debuts in the platform.
Any pointer as to where I can look for samples of code that could handle something like this? Maybe an app that does this or something? The missing splash screen was a holdover from when it was a part of proTeXt only, so I'll fix that. Lastly, should I just remove the other registry stuff for now? Or wait until it's in the platform.
See below for the code that handles waitforexe on the launchr level, that might help.
As for the registry stuff - so long as the app itself doesn't create those keys every run (it shouldn't, those are usually on install only), you're fine to leave that code in until file associations comes out.
Can any of the devs who worked on the development of the Launcher itself point me toward what segment file controls the WaitForNExe lines? I tried looking in InstanceManagement.nsh, but I couldn't find where it was. Before you ask, the reason is that I want to see if I can tweak it slightly to look for tasks that don't have a ".exe" at the end (if that really is the issue).
Lines 285 - 311 in this file: http://portableapps.hg.sourceforge.net/hgweb/portableapps/launcher/file/...
I think I'll see how it's handled and then see if I can't tweak my copy of the launcher to work with it better. I already did that for the JDK (today, whilst trying to find this data myself). Thanks again for your help.
I found the actual source of the process handling (which is where the name actually comes into play) which was ProcFunc.nsh. In there, every place there was a "${If} $2 == ".exe"" I added after it "${OrIf} $2 == ".tmp"" and BAM! it was fixed. Not something that everyone would need, but it's a quick little fix that made it work.
Some lines of code in your file MiKTeXPortable.ini are unclear. Pursuant to the code in the section [RegistryKeys] the code should be in the section [RegistryCleanupIfEmpty] as follows:
However, since usually the registry key FileExts will never be empty, so the above section [RegistryValueBackupDelete] is completely superfluous.
Also your code in the section [RegistryValueBackupDelete] is doubtful. Here is missing the value of the registry key "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tex", which get backed up before hand and restored later, but any value which may have been set while the portable application is running will be deleted.
... I think I copied the code for dealing with file extensions from somewhere else, but as I learned after, all of that code will be useless when it's inbuilt in the platform. So *jedi hand wave* this is not the code you're looking at... anymore, at least.