After having a look at the association code (see below for a part of it), the verb is actually the 'CommandDescription' field. I'll mention this in the documentation. Maybe it would be a good idea to create a new field just for the used verb but I don't know how this would influence the execution of the files in any way. Will have to read more on this.So I thought that in the dialog, I had to specify the verb with which the given command should be associated. Now you explained that the field actually is for the description. I think this implies, that Bytessence InstallMaker automatically uses open as verb in this context, doesn't it? If this is true, maybe it could be mentioned somewhere in the documentation?
Code: Select all
Procedure.i Reg_AssociateFile(Extension.s,ExtensionDescription.s,ExePath.s,IconPath.s,ProgramKey.s,CommandDescription.s,Parameters.s)
;{ Prepare data
Extension = Trim(Extension)
ExtensionDescription = Trim(ExtensionDescription)
ExePath = Trim(ExePath)
IconPath = Trim(IconPath)
ProgramKey = Trim(ProgramKey)
CommandDescription = Trim(CommandDescription)
Parameters = Trim(Parameters)
If Left(Extension,1) = "."
Extension = Mid(Extension,2,Len(Extension)-1)
EndIf
AutoFileKey.s = Extension+"_auto_file"
If Left(Extension,1) <> "."
Extension = "."+Extension
EndIf
If Left(ExePath,1) <> Chr(34)
ExePath = Chr(34)+ExePath
EndIf
If Right(ExePath,1) <> Chr(34)
ExePath = ExePath+Chr(34)
EndIf
If Parameters = ""
Parameters = Chr(34)+"%1"+Chr(34)
EndIf
If Left(Parameters,1) <> Chr(34)
Parameters = Chr(34)+Parameters
EndIf
If Right(Parameters,1) <> Chr(34)
Parameters = Parameters+Chr(34)
EndIf
FinalCommandKey.s = ExePath+" "+Parameters
;}
;{ Add the data in registry
Select OSVersion()
Case #PB_OS_Windows_NT_4, #PB_OS_Windows_2000, #PB_OS_Windows_XP, #PB_OS_Windows_Server_2003, #PB_OS_Windows_Vista, #PB_OS_Windows_Server_2008, #PB_OS_Windows_7 ;{
Reg_CreateKey(#HKEY_CLASSES_ROOT,AutoFileKey)
If Reg_CreateKey(#HKEY_CLASSES_ROOT,Extension)
Reg_SetValue(#HKEY_CLASSES_ROOT,Extension,"",AutoFileKey,#REG_SZ)
If ExtensionDescription <> ""
Reg_SetValue(#HKEY_CLASSES_ROOT,AutoFileKey,"",ExtensionDescription,#REG_SZ)
EndIf
EndIf
If IconPath <> ""
If Reg_CreateKey(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"DefaultIcon") = 1
Reg_SetValue(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"DefaultIcon","",IconPath,#REG_SZ)
EndIf
EndIf
Reg_CreateKey(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"shell")
Reg_CreateKey(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"shell"+"\"+CommandDescription)
If Reg_CreateKey(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"shell"+"\"+CommandDescription+"\"+"command") = 1
Reg_SetValue(#HKEY_CLASSES_ROOT,AutoFileKey+"\"+"shell"+"\"+CommandDescription+"\"+"command","",FinalCommandKey,#REG_SZ)
EndIf
;}
Case #PB_OS_Windows_95, #PB_OS_Windows_98, #PB_OS_Windows_ME ;{
If Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+Extension) = 1
Reg_SetValue(#HKEY_LOCAL_MACHINE,"Software\Classes\"+Extension,"",ProgramKey,#REG_SZ)
EndIf
Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey)
If Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"DefaultIcon") = 1
Reg_SetValue(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"DefaultIcon","",IconPath,#REG_SZ)
EndIf
Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"shell")
Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"shell"+"\"+CommandDescription)
If Reg_CreateKey(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"shell"+"\"+CommandDescription+"\"+"command") = 1
Reg_SetValue(#HKEY_LOCAL_MACHINE,"Software\Classes\"+ProgramKey+"\"+"shell"+"\"+CommandDescription+"\"+"command","",FinalCommandKey,#REG_SZ)
EndIf
;}
EndSelect
;}
;{ Return
ProcedureReturn 1
;}
EndProcedure
I the above code you can also see the problem you mentioned earlier regarding the quotes. My code behaves like developers will only pass one parameter to the executable, that's why it checks for quotes before and after the parameter string

Yes you're right... I'll have a look at this. Thanks for the heads upunder Installer -> Advanced tasks I added several items to the list.
When I move items up or down in the list, the content of the moved items changes!
I observed this with items of the task type "Add registry key".
