Note] piggybank has spent some effort writing this article. Therefore, you must indicate the source when reprinting or referencing it to ensure the integrity of this description and the original article.
If you need to repost in newspapers and periodicals, please contact me. Thank you!
Published in: http://blog.xiaozhu.com/play/
--------------------------------------------------------------------------------
In the subsequent content, I will mainly answer the following questions that some friends often ask but are often not well resolved:
How do I create an uninstall shortcut?
Why don't I run onmaintuibefore and onmaintuiafter when I unmount it?
Why not execute onuninstall when uninstalling it?
Why didn't I call onmaintuibeforexxxx or onuninstall during uninstallation, or even the onbegin, onappsearch, onshowui, and other event handler functions?
Why is the second installation running?ProgramWhen there is no prompt, I uninstalled the previous version and didn't call onmaintuibeforexxxx or onuninstall?
--------------------------------------------------------------------------------
For more information about how to create an uninstall shortcut, see <InstallShield: Creating uninstallation shortcut cut>
Remember the table. The best way to create and uninstall shortcuts in a script is to define the value provided by the constant uninstall_string. In the is operation interface, it is best to refer to the help (see this article) table method to create and uninstall shortcuts. Different methods are used according to different project types. If there is something wrong with the convenient feature provided by is to create a unload shortcut, it is best to change it -- as for the reason, it will be mentioned later.
--------------------------------------------------------------------------------
Why don't I run onmaintuibefore and onmaintuiafter when I unmount it?
Why not execute onuninstall when uninstalling it?
In general information-> project properties, you can see the enable maintenance option. If it is set to yes, when the user runs the installer again on a computer that has already installed the software, the script in the onmaintuibefore and onmaintuiafter event processing functions will be automatically run. If it is set to no, the script of the uninstall event processing function will be called.
If you do not execute the scripts for these two event processing functions during uninstallation, check this setting.
But (haha, there is a "but" here), the two functions and onuninstall may not be run during uninstallation. Please take a look.
--------------------------------------------------------------------------------
Why didn't I call onmaintuibeforexxxx or onuninstall during uninstallation, or even the onbegin, onappsearch, onshowui, and other event handler functions?
1. If the installer runs in "quiet" mode, these event processing scripts will not be executed.
For example, call setup.exe/s or idriver.exe/m {product code}/uninst (see <InstallShield: Creating uninstallation shortcut cut to create and uninstall shortcuts> ).
2. If it is not in "quiet mode", the user directly clicks "delete" next to the program item in the Add/delete program on the control panel, instead of "change ", it runs in removeonly mode. At this time, the maintenance interface is not displayed, but the corresponding script is not executed.
If enable maintenance is set to yes, the script of onmaintuibefore event processing function should be executed according to the above statement, but because of its defaultCode
Therefore, the sdwelcomemaint is not called, and the maintenance interface is not displayed. Therefore, it is easy to mistakenly think that onmaintuibefore has no effect.
Let's take a look at the relationship between the "add and delete programs" button and settings:
The setting result
3. Shortcuts created by different methods may also cause no script to be executed during the uninstall process.
The last time I created an installation program for xzsqldeploy (see the InstallShield example: An Example of InstallShield x provided in the document "demonstrate the use of xzsqldeploy and xziisconfig scripts ), I used the shortcut function provided by is to create and uninstall a shortcut: run the create an unstallation export cut on the left side of application shortcuts in Project Assistant mode (see <InstallShield: creatinguninstallation
Shortcut cut ):
The results show that the shortcut adopts the msiexec.exe/X parameter for uninstallation. Therefore, the uninstallation is not a script that runs under is and does not call the event processing function of is.
Therefore, if you use the shortcut function provided by is to create a shortcut, check its target. If you need to perform some special actions (such as deleting some files in your script or deleting the created IIS Site) during uninstallation ), change it to (here "7" is changed to 8, 9, 10 according to the corresponding is version ):
(See the document "InstallShield: Creating uninstallation shortcut cut" to create and uninstall shortcuts)
[Commonfilesfolder] InstallShield/driver/7/Intel 32/idriver.exe
Together with parameters, it is equivalent
"% Systemdrive %/program files/common files/InstallShield/driver/10/Intel 32/idriver.exe"/m {product code of your product}
If you use uninstall_string according to the above method and debug and output its value, you will find that it is the above content ^ oo ^
--------------------------------------------------------------------------------
Why didn't I call onmaintuibeforexxxx or onuninstall when I uninstalled the installation program for the second time without prompting me?
Note:
Select Options from the Tools menu. On the preferences page in the pop-up window, remove the "Uninstall before installing" option, re-compile and run it.
If enable maintenance is set to yes, execute setup.exe to complete the installation, and then execute setup.exe again, the following maintenance interface will appear:
If enable maintenance is set to no, the onuninstall event processing function script is executed. If you don't want to see the annoying prompt box, you can change it if you like it. ^ oo ^
Feedback
# Xiaozhu.com: [InstallShield] uninstall the piggybank
Ping back from: blog.csdn.net
# Re: [InstallShield] uninstall related questions 2004-10-27 PK
Piggybank: two questions.
1. With InstallShield X, can I remotely call executable programs on another machine in the script? I tried using launchappandwait (). No.
2. how to implement the following functions for the installer: first copy some files to the installed machine, modify the registry, restart the machine, and then execute an executable program that was copied to the machine.
Thank you!
# Re: [InstallShield] uninstall FAQs piggybank
PK, You are welcome
1. launchappandwait in InstallShield does not support network resource access. However, you can test whether it is possible to map network resources to a local hard disk first.
2. Running at startup is generally implemented in a shortcut of the registry run, runonce, or Startup Group.
For example:
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/run
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runonce
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runonceex
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runservices
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runservicesonce
InstallShield also supports restarting during the installation process.
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runonce
HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/runonceex
HKEY_LOCAL_MACHINE/system/CurrentControlSet/Session Manager/filerenameoperations
For example, is monitors whether the items in the above Registry position change during the installation process. If the items change, the system needs to restart.
Of course, you only need to put the shortcut of the program you want to run into the shortcut group.
# Re: [InstallShield] uninstall related questions PK
Piggybank. Thank you for your reply!
I blame myself for not making the situation clear yesterday.
In fact, my current problems are:
Just completed a JSP Information Management System, B/S. The database uses Oracle9i and the OS is windows2000server. I have prepared a database installation and initialization program srvinst executed locally on the database server, including creating users and tables. It is composed of batch processing commands and SQL files. The functions are similar to the xzsqldeploy you provide (I don't have a GUI, it's ugly, huh, huh ). Now that the project is ready for acceptance, the user suddenly asks for a so-called remote database installation program, that is, to run the installation program on any networked machine (the Oracle client may not be installed, you can install and initialize the database on the specified database server. Of course, the premise is that the Oracle instance on the server has been created and the listening and instance services have been started.
I originally considered two solutions:
First, is it possible to remotely access the data in InstallShield? If yes, you can directly call sqlplus on the server to execute the local srvinst. That is, question 1 I asked you yesterday. However, it does not seem to work. I cannot ask the user to map the server network resources to a local hard disk before installation. The leaders can't do that either.
The second is to simply package the Oracle client into the installation program (although there is a copyright issue, it is good that the Oracle client on the server is paid by the user and it will be done ).
Specifically:
1. Copy the client file and database creation and initialization program srvinst (install. BAT and SQL file) of the packaged Oracle 9i to the local machine where the installation program is executed.
2. A dialog box is displayed, asking the user to enter the machine name of the remote ORACLE Server.
3. modify $ ORACLE_HOME/Network/admin/tnsnames in the local Oracle 9i client. in the ora file, change "host = Pk" to "host = machine name of the Oracle server entered by the user ".
4. Import the registry of the client related to Oracle 9i.
5. Restart the machine.
6. Call the install. BAT file locally through the launchappandwait () function in the script to remotely create and initialize the database.
During the installation process, restart the machine and continue the remaining installation process. I have never been able to solve this problem, that is, question 2 I asked you yesterday.
Well, I have been talking about it for a long time. The main reason is that I think the method you mentioned in the registry is not applicable to me. I also want to hear your opinion and see if I am doing this.
By the way, yesterday in csdn found a post with your reply: http://search.csdn.net/Expert/topic/2105/2105147.xml? Temp =. 7887689.
Your processing method seems to be suitable for me, but I tried and failed. Which of the following is probably incorrect? I just used InstallShield X. It is unclear in many places. Could you please elaborate. My MSN is: pk010@hotmail.com, can you add me?
Say a digress, youArticleWhat software is used for processing the images in? It's pretty nice. I want to learn.
# Re: [InstallShield] unload problems piggybank
For Network ing, you can use net.exe provided by CMD shell to implement: net use... (Use Net help use to view details ). Of course, this method is not good.
You are talking about installing the client on the target computer. In fact, if the computer needs to operate on the remote database server, it indicates that the computer is used as the management computer. Therefore, installing the Oracle client is logically correct.
Another alternative is to write a program in Java to set the remote database server, compile it as EXE, and adopt the appropriate JDBC driver, so you do not have to rely on the client to support it. However, deploying j2se, j2sd, and JDBC drivers is equally troublesome. (This reminds me to create a Java version that supports Oracle/MySQL following xzsqldeploy)
For Web application deployment, I always think that configuring webserver/dbserver during installation is not a good solution. That is to say, this is logically different from the installation.
In fact, according to the steps listed above, running install. bat is actually a task after installation. Logically, it is also consistent with the above viewpoint. Then, it is different from the "continue installation after restart" mentioned in that post.
Therefore, we can solve the problem of "how to restart" or "How to prompt the user to restart.
For restart, the above response mentioned that if the Startup Group or registry items are changed during installation, the system prompts the user to restart the installation. If you want to force a restart or explicitly prompt the user to restart, you need to change it in the script.
For example, the sdfinishreboot or rebootdialog dialog box is used (please take a look at the help box and you have been busy recently ). After the system restarts and runs your batch processing, it will be OK.
Oh, as for images...
It uses snagit 7.x to capture images and use its image processing function. ^ oo ^ is recommended.
# Re: [InstallShield] uninstall FAQs piggybank
By the way, remember that system can restart the system and check the following parameters:
Try again:
System (sys_bootmachine );
System (sys_bootwin );
I have seen this usage in previous versions of help, but the documentation associated with ISX does not seem to be correct, so the specific address cannot be found, if you remember correctly, the above two commands can also restart the system without prompting the user.
Of course, the current user must have sufficient permissions.
# Re: [InstallShield] unload problems piggybank
Well, OK.
ISX recommends sdfinishreboot or rebootdialog, while System (sys_bootmachine) is only set to be compatible with previous professional versions.
The former has a dialog box prompting users, which is more friendly. The latter directly tries to restart.
# Re: [InstallShield] uninstall related questions PK
Haha, your reply is so fast.
Thank you. Try it now!
# Re: [InstallShield] uninstall FAQ fangzq
How can I delete files installed in the system directory when they are detached? The description of permanent in component indicates that all files under systemfolder are not deleted. Is there any solution? Thank you.
# Re: [InstallShield] uninstall problems piggybank
I had answered your questions on csdn Forum
# Re: [InstallShield] uninstalling James
Ask you a question.
I have made 2 release, one single file, and one multi-file in a project.
Why does the welcome window appear when multiple files are uninstalled after compilation, but not for a single file? enable maintenance has been set to No, cannot multiple release exist in a project at the same time? Please help me solve the problem. Thanks very much!
# Re: [InstallShield] uninstall question James
Sorry, I forgot to say that the InstallShield I use is 9.0.
# Re: [InstallShield] unload problems piggybank
No, I used is9 for a while. Different release packages are just different packaging methods (for example, whether the isscript engine is included or compressed). Are you using different uninstallation methods? For example, in quiet uninstall mode or with msiexec.
If enablemaintenance has been set to no, there should be no maintenance interface -- we suggest you look at the onmaintbefore event processing code. I'm not sure about the specific differences between is9 and ISX (haha, after all, I don't need to compare each version), but ISX has slightly adjusted some details. Maybe the problem is here.
Also, after modifying the settings, have you recompiled both release versions? During the test, have you uninstalled the original installation and tested it in the same new release?
Let's take a look at how to eliminate these interference. It is certain that not only can there be multiple release in a project, but also multiple patches.