Add "Configure" option to image converter context menu submenu#22
Conversation
Co-authored-by: pg94au <[email protected]>
| exePath.resize(wcslen(exePath.c_str())); | ||
| RegCloseKey(hKey); | ||
|
|
||
| // Replace the ImageConverter.exe filename with Configure.exe in the same directory. |
There was a problem hiding this comment.
Wouldn't it make more sense to have the folder name stored in the registry by the installer, and then just append either ImageConverter.exe or Configure.exe to that as needed, than to do a string replacement like this? Or possibly have two registry entries, one for each full executable path?
There was a problem hiding this comment.
@copilot Wouldn't it make more sense to have the folder name stored in the registry by the installer, and then just append either ImageConverter.exe or Configure.exe to that as needed, than to do a string replacement like this? Or possibly have two registry entries, one for each full executable path? Can you make whichever change ends up being simpler?
There was a problem hiding this comment.
Went with storing the install folder in the registry — added an InstallPath value (set to {app} by the installer) so OnConfigure can directly append Configure.exe without any string manipulation. Commit 697680c.
There was a problem hiding this comment.
@copilot ExecutablePath is still there in there in the registry, now that InstallPath is there. What do you think about just leveraging that one value and executing the converter application by building the full path in the same way that it is being done with configuration?
There was a problem hiding this comment.
Done in commit 3c72134. ExecutablePath has been removed from the registry — both RunConverterCommand and OnConfigure now read InstallPath and append the respective filename (ImageConverter.exe / Configure.exe).
…blePath Co-authored-by: pg94au <[email protected]>
Co-authored-by: pg94au <[email protected]>
Adds a localized "Configure" menu item to the Convertster shell extension submenu, separated from the JPG/PNG conversion options by a divider. Selecting it launches
Configure.exefrom the install directory.Changes
resource.h— New string IDIDS_CONFIGURE(204)common.h— Fallback hardcoded constantL_ConfigureFileContextMenuExt.h—IDM_CONFIGURE = 2enum value,m_configureTextBufmember,OnConfigure()declarationFileContextMenuExt.cppQueryContextMenu: appendsMF_SEPARATORthen the Configure item after JPG/PNG entries;largestIdis now alwaysIDM_CONFIGUREOnConfigure: reads theInstallPathregistry value to locateConfigure.exe, validates existence, launches viaCreateProcessWRunConverterCommand: updated to readInstallPathand appendImageConverter.exe, consistent with howOnConfigureresolves its pathInvokeCommand: dispatchesIDM_CONFIGUREtoOnConfigureConvertsterContextMenuHandler.rc—IDS_CONFIGUREadded to all five language string tables:Installer/Installer.iss— Replaced theExecutablePathregistry value with a singleInstallPathvalue (set to{app}). BothImageConverter.exeandConfigure.exeare located at runtime by appending their filename to this path.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.