> For the complete documentation index, see [llms.txt](https://tonyliu.gitbook.io/macos-packaging/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tonyliu.gitbook.io/macos-packaging/untitled.md).

# 第四章：暗度陈仓

前面介绍了安装包的组成和如何处理安装包负载，本章介绍其中一个重要的组成部分：脚本。安装包脚本可以提供给制作安装包的人员以极大的灵活性。在实际安装时，它可对目标系统进行预判后做出适当的处理，在文件复制完成后做好善后处理等等。

通过，本章的学习就可以了解脚本是如何在用户不知不觉中，修改系统和用户环境的。所以，在前面本书强调对非确认来源的安装包特别小心。&#x20;

本章从一个简单的卸载的例子开始，后面详细解释安装包脚本的各个方面。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tonyliu.gitbook.io/macos-packaging/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
