我覺得這是一個很奇怪的問題,但無論如何...註冊表項編寫的,但沒有上下文菜單項
我已經創建了兩個C#應用程序,himgr.exe
和cimgr.exe
。它們與Inno Setup一起安裝,並複製到C:\Program Files [(x86)]\Imgr Suite
。
他們就完成了,通過在explorer.exe
上下文菜單項中使用,所以我配置了installator在註冊表中創建幾個鍵:
[Registry]
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
完全安裝腳本here。
注意:我也嘗試過HKCR\jpegfile
等,它爲我工作,但...
無論使用以上(使用HKLM
),也不與HKCR
,對一些人來說這是行不通的腳本。 6人中有4人曾嘗試過,但沒有發現任何問題,並且按照預期工作,但是對於2人而言,它沒有發生任何問題。
這些條目在註冊表中,但沒有上下文菜單條目。
對於測試人員之一,編輯與jpegfile
關鍵的GIMP項目,儘管存在於註冊表,在右鍵菜單中沒有顯示任何。此外,對於相同的測試儀,上下文菜單的Preview條目顯示爲兩次。
In this thread你有關於程序本身和測試的更多信息。包含編譯安裝程序所需的所有文件的RAR文件可用here。
這真的令我擔心,我們無法找到解釋爲什麼它不起作用。
最有可能的是,沒有工作的人擁有與「giffile」或「jpegfile」不同的ProgId關聯的.gif和/或.jpg。 – Miral
哦謝謝!我怎樣才能使用Inno Setup將密鑰添加到正確的ProgId中? –
問題可能是由於權限造成的。您需要管理員權限才能在HKCR和HKLM中創建密鑰 –