Project corruption with /DelShortcut / /NewShortcut? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Project corruption with /DelShortcut / /NewShortcut?

Hello everyone.

- Create a new enterprise project
- Save in parent folder of Advanced Installer installation directory as "test.aip"
- Add file "test.aip" to project on "Files and Folders" in "Application Folder"
- Save project, close Advanced Installer
- Open cmd.exe, cd to folder with "test.aip"
- Execute the following in cmd.exe (replace "AdvancedInstaller_6.5.2\" with actual AI folder name):

Code: Select all

AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test1" -dir "SHORTCUTDIR"

AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test1" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"

AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test2" -dir "SHORTCUTDIR"

AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test2" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"
Output:

Code: Select all

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test1" -dir "SHORTCUTDIR"

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test1" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test2" -dir "SHORTCUTDIR"

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test2" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"
- Execute the same again:

Code: Select all

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test1" -dir "SHORTCUTDIR"

Exception - A row with this key [id \AdvancedInstaller_6.5.2\AdvancedInstaller.exe#0] was already registered in the table.

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test1" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"

Exception - A row with this key [id \AdvancedInstaller_6.5.2\AdvancedInstaller.exe#0] was already registered in the table.

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /DelShortcut -name "test2" -dir "SHORTCUTDIR"

Exception - A row with this key [id \AdvancedInstaller_6.5.2\AdvancedInstaller.exe#0] was already registered in the table.

> AdvancedInstaller_6.5.2\AdvancedInstaller.com /edit test.aip /NewShortcut -name "test2" -dir "SHORTCUTDIR" -target "APPDIR\test.aip" -icon "AdvancedInstaller_6.5.2\AdvancedInstaller.exe"

Exception - A row with this key [id \AdvancedInstaller_6.5.2\AdvancedInstaller.exe#0] was already registered in the table.
Am I doing something wrong?

What is /NewShortcut supposed to do when the shortcut already exists?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Project corruption with /DelShortcut / /NewShortcut?

Hi Clemens,

This behavior is caused by a bug in Advanced Installer which will be fixed in a future version. Thank you for bringing this to our attention.

Until this bug is fixed, you can try this workaround:
- after you run the first set of commands open the AIP with a text editor
- find the "caphyon.advinst.msicomp.MsiIconsComponent" component
- make sure that all the icons have different Indexes (if two icons have the same index, modify the index of one of them)
- save and close the AIP

Basically, the "NewShortcut" command does not verify if the icon used by the shortcut is already in the project. Therefore, it creates it again by using the same index.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Project corruption with /DelShortcut / /NewShortcut?

Hello Cosmin,

thank you for the swift reply and workaround suggestion.



With best regards

Clemens Anhuth

Return to “Common Problems”