You are here

Wait for EXE issue

10 posts / 0 new
Last post
darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Wait for EXE issue

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
Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 days 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
not an exe

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.

darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Thanks Gord

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.

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 days 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
see below

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.

darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Additional Inquiry

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).

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 days 22 hours ago
DeveloperModerator
Joined: 2008-07-24 18:46
here
darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Thanks again

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.

darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Easy solution

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.

tapsklaps
Offline
Last seen: 5 years 11 months ago
Developer
Joined: 2010-10-17 08:11
messy code

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:

[RegistryValueBackupDelete]
1=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

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.

darksabre76
darksabre76's picture
Offline
Last seen: 3 months 1 week ago
Developer
Joined: 2011-04-19 23:28
Honestly...

... 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.

Log in or register to post comments