iPersistfile and innosetup 6

354 views
Skip to first unread message

Thierry Cornu

unread,
Nov 5, 2020, 10:19:12 AM11/5/20
to innosetup
Hello,

Same script work perfectly with Innosetup 5. 
With v6 I have an error when crating icon on c:\....\Desktop\xxx.lnk

iPersistFile::save 
Error 0x80070005
Accès interdit

Setup made without admin privileges.
What is the problem ? How to resolve it ?

Greatings,
Thierry

Thierry Cornu

unread,
Nov 5, 2020, 10:52:46 AM11/5/20
to innosetup
Hum, with V5, icons are created in user folder, with v6 in public folder... !? It is the same script...

Thierry Cornu

unread,
Nov 5, 2020, 11:17:20 AM11/5/20
to innosetup
Ok, found the solution in Revision history : "
  • Change in default behavior: The "common" shell folder constants are no longer mapped to their "user" form if the installation is running in non administrative install mode. Instead they simply return the requested common directory. The list of affected "common" constants is: {commonappdata}, {commondesktop}, {commondocs}, {commonprograms}, {commonstartmenu}, {commonstartup}, and {commontemplates}."
So need to manually manage where icons are created, using IsAdminInstallMode support function

Jernej Simončič

unread,
Nov 5, 2020, 11:26:39 AM11/5/20
to Thierry Cornu on [innosetup]
On Thursday, November 5, 2020, 17:17:19, Thierry Cornu wrote:

> So need to manually manage where icons are created, using
> IsAdminInstallMode support function

No, read the full release notes. Inno now properly supports per-user and system-wide install mode in the same installer, but you need to adjust your script (hint: look for {auto*} constants).

--
< Jernej Simončič ><><><><>< https://eternallybored.org/ >

A chicken doesn't stop scratching just because the worms are scarce.
-- Grandma Soderquist's Conclusion

Thierry Cornu

unread,
Nov 5, 2020, 11:29:30 AM11/5/20
to innosetup
Yes, I think I have just to replace
Name: {commondesktop}\{code:IconName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\logo.ico
with 
Name: {autodesktop}\{code:IconName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\logo.ico


Reply all
Reply to author
Forward
0 new messages