Per-User installation putting shortcuts in wrong path - Advanced Installer Community
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Per-User installation putting shortcuts in wrong path

I'm creating an installer with the InstallTypeDlg and performing a per-user installation without elevation. I'm also using the ShortcutsDlg and StartMenuShortcutsDlg (which has a typo in v11.4.1 build 587484 which may have since been fixed, but just in case, it has '&Start Menu Shortcuts Folder:' as the combo box label instead of 'Start Menu Shortcuts Folder').

During the installation if I include Start Menu Programs folder I get the following error:

Code: Select all

The installer has insufficient privileges to access this directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\<Product_folder>. The installation cannot continue. Log on as administrator or contact your system administrator.
As a per-user installation I would have thought that it would stick the shortcut menu items in %APPDATA%\Microsoft\Windows\Start Menu\Programs\<Product_folder>. I have added an Init Event to the ShoftcutsDlg that sets the SHORTCUTDIR property to the one mentioned above but this had no effect (I added a label to the dialog to verify that it was indeed changing the property value).

Should I be updating a different property? Is this intended behaviour for a per-user installation?

EDIT: I removed my Init Event and kept the label and the path is correctly updated based on the installation type by the installer. I'm not sure why it's trying to update the shortcuts for the machine instead of the user when I use that dialog. If I move that dialog out of the sequence, it installs the shortcuts correctly.

EDIT 2: I removed the StartMenuShortcutsDlg and was again able to install correctly. It seems that this dialog is in fact the culprit.

Thank you,

- Adam
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per-User installation putting shortcuts in wrong path

Hello Adam,
I'm creating an installer with the InstallTypeDlg and performing a per-user installation without elevation. I'm also using the ShortcutsDlg and StartMenuShortcutsDlg (which has a typo in v11.4.1 build 587484 which may have since been fixed, but just in case, it has '&Start Menu Shortcuts Folder:' as the combo box label instead of 'Start Menu Shortcuts Folder').
Indeed, this is an Advanced Installer glitch, thank you for pinpointing this. A fix will be available in a future version of Advanced Installer. Until then, as a workaround, you should just select the "ShDirLabel" control and from the "Properties" right pane set the "No Prefix" attribute to false. Also, please keep in mind that this edit requires the "Dialog Editor" feature available only into an "Enterprise" or higher project type.
During the installation if I include Start Menu Programs folder I get the following error:

Code: Select all

The installer has insufficient privileges to access this directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\<Product_folder>. The installation cannot continue. Log on as administrator or contact your system administrator./code][/quote]
I've tested the scenario but I cannot replicate the behavior. Can you please send us the .AIP (project file) and a [url=http://www.advancedinstaller.com/user-guide/qa-log.html]verbose log[/url] of the installation to [b]support at advancedinstaller dot com[/b] so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Per-User installation putting shortcuts in wrong path

Thank you Daniel, I've sent the requested information.

Cheers,

- Adam
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per-User installation putting shortcuts in wrong path

Hello Adam,

Regarding "StartMenuShortcutsDlg" dialog issue, I've tested the scenario and I replicated the behavior. This happens when you are using a "Per-machine if user is administrator, per-user otherwise" installation type with the "InstallTypeDlg" dialog added and choosing a per-user installation. This scenario gets in conflict with the "StartMenuShortcutsDlg" dialog functionality, because the latter dialog set the "Application Shortcut Folder" to a per-machine location no matter what installation type you selected in "InstallTypeDlg" dialog.

This is an Advanced Installer limitation, thank you for bringing it to our attention. A fix will be available in a future version of Advanced Installer. We'll let you know when the fix will be out. Until then, unfortunately you should delete the "StartMenuShortcutsDlg" dialog from your project in order to avoid the related behavior. Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Per-User installation putting shortcuts in wrong path

Daniel,

I'll implement something on the ShortcutsDlg to combine the functionality of the two. Thanks for taking the time to investigate!

- Adam
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per-User installation putting shortcuts in wrong path

You're always welcome Adam.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Per-User installation putting shortcuts in wrong path

As a work around I've added a Published Event to the InstallTypeDlg's Next button which sets [ProgramMenuFolder] to [%APPDATA]\Microsoft\Windows\Start Menu\Programs when AI_InstallPerUser.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Per-User installation putting shortcuts in wrong path

Indeed, this is a valid workaround. I'm glad you got this working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Per-User installation putting shortcuts in wrong path

Hello,

This was fixed in version 11.8 of Advanced Installer released on January 28th, 2015.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”