Asociación de archivos de Inno Setup
Resuelto
MemeTech
Mensajes publicados
90
Estado
Miembro
-
MemeTech Mensajes publicados 90 Estado Miembro -
MemeTech Mensajes publicados 90 Estado Miembro -
¡Hola!
Imagino que ya se ha hecho esta pregunta aquí, pero o no la encuentro, o no funciona en mi caso, o simplemente no sé programar en Inno Setup...
En cualquier caso, me pregunto cómo asociar los archivos WAV y OGG a mi reproductor de música desde el instalador.
¿Cómo es posible?
¡Gracias!
Imagino que ya se ha hecho esta pregunta aquí, pero o no la encuentro, o no funciona en mi caso, o simplemente no sé programar en Inno Setup...
En cualquier caso, me pregunto cómo asociar los archivos WAV y OGG a mi reproductor de música desde el instalador.
¿Cómo es posible?
¡Gracias!
4 respuestas
-
Hola MemeTech,
En la FAQ de Inno Setup, esto se encuentra:
https://jrsoftware.org/isfaq.php#assoc
Creating File Associations
First set the [Setup] section directive "ChangesAssociations" to "yes". Then create [Registry] entries as shown below to create a file association for all users (requires administrative privileges.)
[Registry]
Root: HKLM; Subkey: "Software\Classes\.myp"; ValueType: string; ValueName: ""; ValueData: "MyProgramFile"; Flags: uninsdeletevalue
".myp" is the extension we're associating. "MyProgramFile" is the internal name for the file type as stored in the registry. Make sure you use a unique name for this so you don't inadvertently overwrite another application's registry key.
Root: HKLM; Subkey: "Software\Classes\MyProgramFile"; ValueType: string; ValueName: ""; ValueData: "My Program File"; Flags: uninsdeletekey
"My Program File" above is the name for the file type as shown in Explorer.
Root: HKLM; Subkey: "Software\Classes\MyProgramFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MYPROG.EXE,0"
"DefaultIcon" is the registry key that specifies the filename containing the icon to associate with the file type. ",0" tells Explorer to use the first icon from MYPROG.EXE. (",1" would mean the second icon.)
Root: HKLM; Subkey: "Software\Classes\MyProgramFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MYPROG.EXE"" ""%1"""
"shell\open\command" is the registry key that specifies the program to execute when a file of the type is double-clicked in Explorer. The surrounding quotes are in the command line so it handles long filenames correctly.
To create a file association for the current user instead of for all users use HKCU instead of HKLM.
Dal -
Gracias por su respuesta tan rápida. Voy a mirar eso, le doy noticias.
-
Buuuuuuuuuen...
Intenté, pero sin mucho resultado: mis claves de registro parecen válidas (no hay mensaje de error al instalar), pero el ícono de mi programa no aparece en mis archivos y lo más importante:
¡no es posible abrir mis archivos automáticamente!
Debo haber cometido un error crucial... ¿pero dónde?
[Registry] Root: HKLM; Subkey: "Software\Classes\.ogg"; ValueType: string; ValueName: ""; ValueData: "MPlayerFile"; Flags: uninsdeletevalue Root: HKLM; Subkey: "Software\Classes\MPlayerFile"; ValueType: string; ValueName: ""; ValueData: "MPlayer OGG File"; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Classes\MPlayerFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MPlayer.exe,0" Root: HKLM; Subkey: "Software\Classes\MPlayerFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """"{app}\MPlayer.exe"" " ""%1"""""
PD: No olvidé la línea ChangesAssociations=yes -
Extrañamente, al configurar las claves del registro solo para el usuario actual, funcionó...
Bueno, no voy a intentar entenderlo, ¡me sirve así!
Asunto resuelto, ¡gracias de nuevo!