Problem packaging templates for MS Office - 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!

Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Problem packaging templates for MS Office

Hello,

I’m hoping someone in this forum may be able to help me out with this.

I’ve built a set of custom MS Office templates for different versions of the software and I want to create a shortcut to the templates in the user’s MS Office Startup folder, so that the templates automatically load whenever the application is started. I am using Advanced Installer to package the templates.

The problem I have is that I don’t know what version of the software the user has and whether MS Office was installed in the default Program Files folder, so hard coding the shortcuts for different version of the software in Advanced Installer is not really an option.

I’ve also tried running a VBScript to launch an instance of the Application that checks the software’s version and installation path but it doesn’t work, making Advanced Installer halt during the installation.

All ideas are welcome. Thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem packaging templates for MS Office

Hi,

In order to find the installation folder of the application (if it's installed), you can use a search. For example, you can search for the main EXE of the application or a registry entry which contains the installation path.

Once you find the installation path, you can create a property-based folder in the Files and Folders page. In this folder you can add the templates so they are installed in the application folder. When you create the shortcuts, they can point to this property-based folder.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: Problem packaging templates for MS Office

Many thanks for your reply Cosmin,

I'm looking at the search option for the EXE file but it returns the path and the file name. Would you (or anyone else for that matter) happen to know how I can I extract the path only?

I've tried a VBScript to manipulate the string but the installer aborts. The second problem I have is passing the value of the VBScript function back to the installer as a Property. I've searched the forum but can't find similar questions posted.

Thanks very much for any kind of help you can give me.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Problem packaging templates for MS Office

Hi,
Would you (or anyone else for that matter) happen to know how I can I extract the path only?
Please note that this is explained in the Remove a file or a folder during installation how-to (the "Find the folder which contains a file" section).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: Problem packaging templates for MS Office

Hi Cosmin,

Thanks for all your help and pointing me in the right direction. I have a working version now of my package. Just need to polish it a bit!

I have created the search query and a property-based folder and put all my shortcuts there. I now need to find a way to just install the shortcut that is relevant to the MS Office version the user has.

Any ideas?

Best regards

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

Re: Problem packaging templates for MS Office

Hi Sara,

For this you can use shortcuts to external files and components which are installed only for a specific Office version. For more details, please see the Create shortcut only if a feature is installed how-to in the User Guide.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: Problem packaging templates for MS Office

Hi Cosmin,

Thanks very much for that.

I have another question regarding this issue, namely I need to find out if it's possible to pass the value of a Search to a Custom Action function that will copy a file to a property-based folder.

I looked at the step-by-step tutorial on how to select an external file during the installation, which is particularly relevant to this. However, when I downloaded the Browse for File example the project file looked totally different to the project described in the tutorial.

Best regards

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

Re: Problem packaging templates for MS Office

Hi Sara,
I need to find out if it's possible to pass the value of a Search to a Custom Action function that will copy a file to a property-based folder.
The name of a search is actually an installer property which will contain the result of the search. Please note that installer properties cannot be passed as parameters to a function in a custom action. However, you can access a property from inside the custom action. For VBScript you can use Session.Property:
- get the value of a property: myprop = Session.Property("MY_PROPERTY")
- set the value of a property: Session.Property("MY_PROPERTY") = myprop

In a DLL custom action you can use the MsiGetProperty and MsiSetProperty functions. Note that the User Guide contains a sample C++ DLL custom action which may help you.
when I downloaded the Browse for File example the project file looked totally different to the project described in the tutorial.
I checked the sample project for the "Browse for File" tutorial and it is configured just like explained in the tutorial. Please note that this tutorial explains how to get the path of the select file and copy it to the location you want.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: Problem packaging templates for MS Office

Hi Cosmin

So great having someone helping me with this along the way. In reply to your comment earlier:
I checked the sample project for the "Browse for File" tutorial and it is configured just like explained in the tutorial. Please note that this tutorial explains how to get the path of the select file and copy it to the location you want.
When I launch the download copy, I get:

"Error Dialog - Exception - The Attribute name "DefaultDir" of element "Rows" does not match the Directory table schema."

Then, the project loads but only the Settings, Definition and Details pages are available.

Not sure what may be wrong at my end.

Best regards

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

Re: Problem packaging templates for MS Office

Hi Sara,

Can you please specify which Advanced Installer version are you using to open the project? I tested it with the 6.4.1 version and it is opened correctly.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: Problem packaging templates for MS Office

Thanks Cosmin. I was using a much older version of the software. I can see the sample files now.

Best regards

Sara
Samsara
Posts: 8
Joined: Thu Jul 17, 2008 4:38 pm

Re: SOLVED - Problem packaging templates for MS Office

Hi Cosmin,

Just wanted to thank you for all your help. I've got the package working and fully customised to my needs.

Best regards

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

Re: Problem packaging templates for MS Office

Hi Sara,

You're welcome. If you have other questions, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”