Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[feat] Background image needed for DMG distribution file for OSX #4669

Closed
alfreddagenais opened this issue Jul 14, 2022 · 5 comments · Fixed by #7964
Closed

[feat] Background image needed for DMG distribution file for OSX #4669

alfreddagenais opened this issue Jul 14, 2022 · 5 comments · Fixed by #7964

Comments

@alfreddagenais
Copy link

Describe the problem

I search into the documentation for the background image for a .DMG file and I not found it. I need this image when I build for MacOs.

Have a solution now or it will came soon?

Describe the solution you'd like

I just saw examples like this :
687474703a2f2f692e696d6775722e636f6d2f6c6153423432782e706e67

38463339-8e93445e-3ac6-11e8-82f8-58e6cd789077

38463360-f9bb695a-3ac6-11e8-87af-e56fbce03da9

38463361-ff0480f4-3ac6-11e8-8256-1962981b7f71

Alternatives considered

I saw the file bundle_dmg.sh from the build folder src-tauri/target/release/bundle/dmg/bundle_dmg.sh and into this file i have an option for the background

Capture-2022-07-14_01-24-03-000321

But I have no idea where I can find this file.

Capture-2022-07-14_01-25-44-000323

Additional context

No response

@Blatman
Copy link

Blatman commented Aug 23, 2022

Also looking at this part of the bundling process. The basic DMG bundling works very well but I'm at a loss at how to customise certain parts. I would at least like to use a custom background and a volume icon for the DMG itself. At the moment the first icns file found in the icons folder appears to be used (icon.icns) which is the app icon itself and unable to find a way to link a background image. The bundle_dmg.sh can't be edited as all the files appear to be regenerated on each build (both the Vol_Name and Vol_Icon in the generated .sh file just point to $2). Unable to find where the .sh script is generated from. Unable to find any sample apps with customised DMG's. Hate to think that this rudimentary customisation may involve a GitHub fork of Tauri.

@ahkohd
Copy link
Member

ahkohd commented Sep 10, 2022

I was able to make this work for my Tauri app DMG. I had to do it manually using create-dmg.

Build your Tauri app. Get the path to the YourApp.app.

Install create-dmg:

$ brew install create-dmg

Build the DMG from the YourApp.app, pass the installer background option:

$ create-dmg
    --volname "YourAppName" \
    --volicon "path/to/your/icon.icns" \
    --background "path/to/your/background/image.png" \
    --window-pos 200 120 \
    --window-size 835 600 \
    --icon-size 128 \
    --icon "YourApp.app" 230 295 \
    --hide-extension "YouApp.app" \
    --app-drop-link 593 295 \
    "path/where/your/dmg/will/be/generated.dmg" \
     "path/to/YourApp.app"

You can find the reference on how to use create-dmg here.

An example of how I used the create-dmg for my app:

$ create-dmg \
    --volname "Zap" \
    --volicon "./src-tauri/icons/icon.icns" \
    --background "./src/assets/installer-background.png" \
    --window-pos 200 120 \
    --window-size 835 600 \
    --icon-size 128 \
    --icon "Zap.app" 230 295 \
    --hide-extension "Zap.app" \
    --app-drop-link 593 295 \
    "./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Zap.dmg" \
    "./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Zap.app"

Result:
image

@alfreddagenais
Copy link
Author

@ahkohd thank you for the hint! I will try this tool to see it!

@ahkohd
Copy link
Member

ahkohd commented Sep 11, 2022

@ahkohd thank you for the hint! I will try this tool to see it!

You're welcome. Keep in mind that you will have to tweak the icon position and design your installer background to match the configuration you provide to the create-dmg tool.

I can share my app's installer background design on Figma so that you can have a head start.

@muryoh
Copy link

muryoh commented Dec 5, 2022

fyi, if you only need to set the background, you can get away with setting some env variables because of the way the create-dmg script was written: https://github.com/create-dmg/create-dmg/blob/412e99352bacef0f05f9abe6cc4348a627b7ac56/create-dmg#L139

Setting BACKGROUND_FILE, BACKGROUND_FILE_NAME and BACKGROUND_CLAUSE in the context of the tauri build command will result in your background file being used

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 26, 2023
hjmallon pushed a commit to hjmallon/tauri that referenced this issue Dec 4, 2023
DannyAziz pushed a commit to General-Collaboration/tauri that referenced this issue Feb 7, 2024
hjmallon pushed a commit to hjmallon/tauri that referenced this issue Mar 2, 2024
hjmallon pushed a commit to hjmallon/tauri that referenced this issue Jun 5, 2024
FabianLars added a commit that referenced this issue Jun 17, 2024
* feat(bundler): add dmg settings, closes #4669 (#7964)

* fix(bundler): lint and cleanup for #7964 (#8275)

* fmt

---------

Co-authored-by: Andrew <andrey255@live.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
@davru davru mentioned this issue Sep 23, 2024
10 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: 📬Proposal
Development

Successfully merging a pull request may close this issue.

5 participants