# 🔧 Outlook Add-in Installation Troubleshooting

## ✅ Files Status (All Fixed)
- ✅ Manifest: `public/outlook-addon/manifest.xml` (3.6KB)
- ✅ HTML: `public/outlook-addon/index.html` (378B)
- ✅ JavaScript: `public/outlook-addon/bundle.js` (156KB)
- ✅ Icons: All sizes created in `assets/` folder
- ✅ URLs: All point to production server
- ✅ GUID: Unique ID generated

## 🚨 Common Installation Errors & Solutions

### Error 1: "Invalid manifest file"
**Cause**: XML syntax or schema issues
**Solution**: ✅ Fixed - Simplified manifest structure

### Error 2: "App domain not allowed"
**Cause**: Domain not in AppDomains list
**Solution**: ✅ Fixed - Added `https://firmly.webiton.pt`

### Error 3: "Resource not found"
**Cause**: Missing icons or HTML files
**Solution**: ✅ Fixed - All resources deployed

### Error 4: "Can't load add-in content"
**Cause**: HTTPS/CORS issues
**Solution**: ✅ Fixed - All URLs use HTTPS

### Error 5: "Falha de carregamento. Verifique o ficheiro de manifesto e tente novamente"
**Cause**: Complex manifest structure or GUID conflicts
**Solutions**:
1. **Try simplified manifest**: `public/outlook-addon/manifest-simple-v2.xml`
2. **Try new GUID manifest**: `public/outlook-addon/manifest-new-guid.xml`
3. **Clear browser cache** and try again
4. **Use URL upload** instead of file upload

## 📱 Installation Methods to Try

### Method 1: Outlook Web (Recommended)
1. **Go to**: https://outlook.office.com
2. **Open any email**
3. **Click "..." menu** (top toolbar)
4. **Select "Get Add-ins"**
5. **Click "My add-ins"** (left sidebar)
6. **Scroll to "Custom add-ins"**
7. **Click "Add a custom add-in"**
8. **Select "Add from file..."**
9. **Upload**: `public/outlook-addon/manifest.xml`
10. **Click "Install"**

### Method 2: Direct URL Upload
Instead of file upload, try:
1. **In "Add a custom add-in"**
2. **Select "Add from URL"**
3. **Enter**: `https://firmly.webiton.pt/outlook-addon/manifest.xml`
4. **Click "Install"**

### Method 3: Admin Center (If you have admin access)
1. **Go to**: https://admin.microsoft.com
2. **Settings** → **Integrated apps**
3. **Upload custom apps**
4. **Upload manifest file**

## 🔍 What Error Message Do You See?

Please share the exact error message you're getting:

- "Invalid manifest file"
- "App validation failed"
- "Resource not found"
- "Domain not allowed"
- "Falha de carregamento. Verifique o ficheiro de manifesto e tente novamente"
- Something else?

## 🧪 Quick Tests

You can test these URLs in your browser:
- https://firmly.webiton.pt/outlook-addon/manifest.xml
- https://firmly.webiton.pt/outlook-addon/index.html
- https://firmly.webiton.pt/outlook-addon/assets/icon-32.png

All should load without errors.

## 🔄 Alternative: Simpler Manifest

If still failing, we can try an even simpler manifest without version overrides.

## 🆕 New Manifest Files for Testing

If the original manifest fails, try these alternatives:

1. **Simplified Manifest**: `public/outlook-addon/manifest-simple-v2.xml`
   - Removes complex version overrides
   - Uses basic MailApp structure
   - More compatible with Outlook

2. **New GUID Manifest**: `public/outlook-addon/manifest-new-guid.xml`
   - Fresh GUID to avoid conflicts
   - Same simplified structure
   - Good for testing

## 🧹 Troubleshooting Steps for "Falha de carregamento"

1. **Clear browser cache** and cookies
2. **Try different browser** (Chrome, Edge, Firefox)
3. **Use incognito/private mode**
4. **Try URL upload** instead of file upload
5. **Test with simplified manifest**
6. **Check if add-in was previously installed** and remove it first