Wise for Windows Installer

Posted on 2005-04-05
Last Modified: 2013-11-14
Wise for Windows Installer Question :

I want to run a SQL script but have certain aspects configurable with the [INSTALLDIR] property.  My script is to attach a database :

sp_attach @database='blah' , @filename1='c:\files\file.mdf' , @filename2='c:\files\file.ldf'

so obviously I want to replace the c:\files\ with whatever the user selects as their target.  The Replacement tab doesn't seem to work.  Any suggestions ?
Question by:dhodge
    LVL 2

    Expert Comment

    When do you run this script? And how do you do this normally?
    LVL 2

    Author Comment

    It needs to be run as a part of the instalation package we are creating
    LVL 2

    Expert Comment

    What SQL server version do you use?

    You need a program to run your script with commandline parameters. Do you have something for that?

    In Wise for Windows Installer you can select "MSI Script" from the bottom and then "Execute Immediate". Place you script execution at the right place e. g. before "RemoveExistingProduct" within a new If/End block.
    LVL 2

    Accepted Solution

    The if statement should have the condition "Not Installed" if you want to run your script only on installation and not uninstallation.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    A short article about problems I had with the new location API and permissions in Marshmallow
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now