I need to correct myself, sorry. It worked on Windows XP because there was not previous track of my app or doc of the same.
first af all, given:
The application name: "Tcal"
The application path: tAppPath = "C:\Program Files\AA_MyApp\Tcal.exe"
The Document extension: ".tcl"
"TcalDoc" is a generic choosen name to reference a Tcal doc file.
Let me correct my code:
Code: Select all
if queryregistry("HKEY_CLASSES_ROOT\.tcl\") <> "TcalDoc" then
get setRegistry("HKEY_CLASSES_ROOT\.tcl\","TcalDoc")
end if
if queryregistry("HKEY_CLASSES_ROOT\TcalDoc\") <>"Tcal document" then
get setRegistry("HKEY_CLASSES_ROOT\TcalDoc\","Tcal document")
end if
put tAppPath & ",1" into tVar
if queryregistry("HKEY_CLASSES_ROOT\TcalDoc\DefaultIcon\") <> tVar then
get setRegistry("HKEY_CLASSES_ROOT\TcalDoc\DefaultIcon\",tVar)
end if
put tAppPath & " %1" into tVar
if queryregistry("HKEY_CLASSES_ROOT\TcalDoc\shell\open\command\") <> tVar then
get setRegistry("HKEY_CLASSES_ROOT\TcalDoc\shell\open\command\",tVar)
end if
Endeed this code works BUT only if there is NOT a previous "usermade" association (with in Explorer)of ".tcl"
I found that, doing a file association in Windows explorer, there are these finding in RegEdit:
- HKCR\.tcl > value="tcl_auto_file" (where I guess "tcl_auto_file" = "TcalDoc")
HKCR\tcl_auto_file\shell\open\command >predefined value= C:\Program Files\AA_MyApp\Tcal.exe %1
HKCR\Applications\Tcal.exe\shell\open\command >predefined= "C:\Program Files\AA_MyApp\Tcal.exe" "%1"
HKCU\software\classes\.tcl >predefined value= "tcl_auto_file"
HKCU\software\classes\Applications\Tcal.exe\shell\open\command > predefined value="C:\Program Files\AA_MyApp\Tcal.exe" "%1"
HKCU\software\classes\tcl_auto_file\shell\open\command >predefined value= C:\Program Files\AA_MyApp\Tcal.exe %1
HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tcl\OpenWithList > name=a value="Tcal.exe" and name= MRUList value= a
I did not mention "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs..." and other incomprensible finding (cache, etc.)
Doing a clean up with regedit and then using the code above, I find:
- HKCR\.tcl >predefined value= TcalDoc (OK)
HKCR\TcalDoc\Defaulticon >predefined value= C:\Program Files\AA_MyApp\Tcal.exe,1
HKCR\TcalDoc\shell\open\command >predefined value= C:\Program Files\AA_MyApp\Tcal.exe %1
HKCU\software\classes\.tcl >predefined value= TcalDoc
HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tcl\OpenWithList > name=a value=Tcal.exe and name= MRUList value= a
HKLM\software\classes\.tcl >predefined value= TcalDoc
HKLM\software\classes\TcalDoc\DefaultIcon >predefined value= C:\Program Files\AA_MyApp\Tcal.exe,1
HKLM\software\classes\TcalDoc\shell\open\command >predefined value= C:\Program Files\AA_MyApp\Tcal.exe %1
So my questions are:
1) should I include in the code some more code, like:
HKCR\Applications\Tcal.exe\shell\open\command >predefined= "C:\Program Files\AA_MyApp\Tcal.exe" "%1"
and also (but I believe it does not matter):
HKCU\software\classes\Applications\Tcal.exe\shell\open\command > predefined value="C:\Program Files\AA_MyApp\Tcal.exe" "%1"
HKCU\software\classes\TcalDoc\shell\open\command >predefined value= C:\Program Files\AA_MyApp\Tcal.exe %1
2) is any way to update trough code the desk icons other then restart or doing a new login ?
3) Should I delete, on Uninstall, the exact same registry of the install ?
Thanks for any help on this
Trevix